Centering a block horizontally

With 'minimal' markup

Internet Explorer 5+, Firefox, Opera, Safari


 <!--[if lt IE 6]><div id="crapper"><![endif]-->

  <p>And some content</p>

 <!--[if lt IE 6]></div><![endif]-->


Good browsers can style the body element. IE5 (crap browser) needs a wrapper; crapper. Internet Explorer 6 in quirks mode needs this wrapper as well. Use <!--[if lte IE 6]> in that case.

Check the source for the CSS.

Home - More stuff