Center Align a Main Content div in All Browsers
Editor's note: after a friendly reader (see comment below) pointed out that this article was a pretty much word-for-word copy of another article, we have removed the text of the original article posted here and instead direct you to the article that was copied, "CSS Crib sheet #3 - Centering a Div," by Andy Budd.
We apologize for this incident. Plagiarism is something we take seriously, and appreciate the opportunity to correct this issue on our site.
Sincerely,
Daniel Read
In my experience, you can
In my experience, you can also add the XHTML Transitional doctype to your document, which then causes IE to render correctly.
My Solution for aligning centre
I always have a wrapper div called page so,
#page
{
position: relative;
left: 50%;
margin-left: -400px;
width: 800px;
}
Ok, so it's for fixed width sites, but thus far this has worked in every scenario I've come across.
Interesting article. Looks a
Interesting article. Looks a bit like one Andy Budd posted two years ago. Hmmm...


Thanks
Great subject, one that many sites try to cover - this seems to be the answer - works fine.