View Single Post
Old 03-15-2004, 09:18 PM   PM User | #10
DougBTX
New Coder

 
Join Date: Jul 2003
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
DougBTX is an unknown quantity at this point
Q. Which method should I use to center my page?

Q. Which method should I use to center my page?

The drawback of the margin: auto; method is that it will not work in IE5. IE5 does (incorrectly) center blocklevel content when text-align: center; is used. So, for IE5, the following code can be used:

Code:
#centred {
	text-align: center; /* IE5 Hack */
}
#centred #inner {
	text-align: left; /* Un IE5 Hack */
	margin: auto;
	width: xxx; /* enter width here */
}
The drawback with the negative margin method is that if the browser window is too narrow for the content, then part of the content will dissapear out of the left hand side of the window, without a scroll bar. The user can then not see that part of the content. Oops.

Later,
Douglas

PS: The complete source for CSS informations: http://css-discuss.incutio.com/?page=FrontPage

If it isn't there, it probably doesn't exist.
__________________
it's web design. me me me them everyone.
~ No more Netscape. No more IE. What is the world comming to? ~

__ :: Our Tiny Planet

Last edited by liorean; 10-31-2004 at 10:44 PM.. Reason: Streamlining FAQ
DougBTX is offline