text
Centering your page in all browsers
If all browsers were standards compliant, centering your page would be simple. All you would need to do, is set a width to the div that your page is wrapped in, and set the left and right margin to auto, like this:
#container{
width:700px;
margin-left:auto;
margin-right:auto;
}
Thanks to Microsoft and more specifically their browser bakers who made Internet Explorer, we need more than just this.
Here are some examples to show you what I mean:
- ex.1: a centered page in all browsers but IE 5
- ex.2: a centered page in IE 5 but not the other browsers
- ex.3: a centered page!
Please note, that by IE 5, I mean only Windows IE 5, as IE 5 for Macintosh is a totally different browser, which behaves just like the other browsers in this matter.