son Posted August 19, 2008 Share Posted August 19, 2008 I have a container as:#container {position:absolute;top:50%;left:50%;height:600px;width:800px;margin-top:-300px;margin-left:-400px;}which centers the container on pageThen I have a div for copyright as:#copy {position:absolute; height:auto; top:auto; margin-top:auto; bottom:3px; margin-bottom:0; right:6px;}which keeps copyright on right bottom side.Now my problem: the copyright info comes up on larger screens. How can I center and middle align my main container while making sure the copyright is in right bottom corner or even lower down if content extends the height of container? It looks rather odd when it is hanging in the air...Son Link to comment Share on other sites More sharing options...
23.12.2012 Posted September 17, 2008 Share Posted September 17, 2008 Hmm... I don't really get it, but I'd suggest you use the following code, in order to centre the page. Also, you can play with the width attribute, but 780px is recommended as a resolution optimization (if the user uses 800x600, he won't be needed to scroll left/right). #container {margin: 0 auto;width: 780px;} As for the copyright, I don't get it: is it used to position text, or is it a whole DIV? Link to comment Share on other sites More sharing options...
jeffman Posted September 17, 2008 Share Posted September 17, 2008 23.12.2012, margin: 0 auto does not work with absolute positioning. Son's centering method is the normal method (and the only one I know that works) for centering absolutely positioned items.Son, look into position: fixed for that copyright. Link to comment Share on other sites More sharing options...
23.12.2012 Posted September 17, 2008 Share Posted September 17, 2008 WITH ABSOLUTE POSITIONING. I thought he did not know of this method, so that's why he tried to make up some code to work with this positioning. Link to comment Share on other sites More sharing options...
son Posted September 23, 2008 Author Share Posted September 23, 2008 23.12.2012, margin: 0 auto does not work with absolute positioning. Son's centering method is the normal method (and the only one I know that works) for centering absolutely positioned items.Son, look into position: fixed for that copyright.Thanks for your input! Will have a go...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.