Forums
This topic is locked
Centering page without tables
Posted 15 Jul 2007 17:57:54
1
has voted
15 Jul 2007 17:57:54 Ingela Grip posted:
--------------------------------------------------------------------------------I'm trying to get the content centered no matter browser/resolution without using tables, but the problem is that when the window is too small for the whole page to show - the user is not allowed to scroll up to the absolut top or to the absolute left? Only a part of the content can be shown - and the menu is unreachable. Please have a look at www.plainvanilla.se
My CSS looks like this for the moment:
#mainContent {
position: absolute;
visibility: visible;
margin-left: -480px;
margin-top: -340px;
left: 50%;
top: 50%;
width: 960px;
z-index: 1;
background-color: #000000;
}
Would really appreciate some help with this - I don't know what to do. I've been trying to find some more info about this for days - but no luck... Thanks in advance!
/Ingela
Replies
Replied 19 Jul 2007 14:33:57
19 Jul 2007 14:33:57 Nick (NR) replied:
remove:
margin-left: -480px;
margin-top: -340px;
and try:
margin: auto;
not a guarantee, someone else may know a better way.
Edited by - NickNR on 19 Jul 2007 14:34:16
margin-left: -480px;
margin-top: -340px;
and try:
margin: auto;
not a guarantee, someone else may know a better way.
Edited by - NickNR on 19 Jul 2007 14:34:16