Centering a DIV
There are, unfortunately, many differences in the way Internet Explorer
and Firefox and other browsers render HTML code. I encountered another
difference between the way they parse HTML code today in code to center a div
If I use the following code, the layer demarcated by the
</div> tags is centered when
viewed in Firefox or Netscape, but not in Internet Explorer.
This should be a block of text centered within the page. The
div tag used is as follows:
When viewed with Firefox or Netscape, the layer is centered within the
page, but not in Internet explorer.
<div style="padding: 5px; width: 300; margin: auto;
border: 3px black solid">
Tested in Firefox 3.0, Internet Explorer 7.0, and Netscape 7.2 on a Windows