Hi,
The comment at the top of the page throws ie6 into quirks mode (which some people call "this designer doesn't know what he's doing mode", but I wouldn't be unkind enough to say that
.
In quirks mode the browser will supposrt legacy and proprietary behaviour and let you get away with such things as leaving the units of the dimension.
Code:
#frame {
/* set the width of the column */
/*WinIE value first, then the desired valuethe next 2 times */
width: 600px;
margin-left: -300; /* 300 what - miles,inches...*/
}
IE in quirks mode guesses you mean px while other browsers do as they are told and ignore anything thay doesn't make sense. make sure you specify the unit e.g. 300px
Although you can centre a page as you have done above a much neater way is to use the folowing code and the page won't slide off the left hand side of the window.
Code:
body {
min-width:600px;/* for compliant browsers*/
text-align:center;/* for ie5 and 5.5. and ie6 in quirks mode*/
}
#frame {
width: 600px;
margin-left:auto;/* centre for good browsers*/
margin-right:auto; /* centre for good browsers*.
text-align:left;
}
The page will now centre and stop at the left edge. If you don't stop at the left edge then people with smaller displays than your column width will never be able to see the content because there is no negative horizontal scrollbar.
Paul
Edit:
I typed too slowly and Vinnie beat me to it
Bookmarks