Forum Moderators: not2easy
If anyone can say whether the ultra simple layout below for header + fixed-right + fluid-left is robust on Wintel IE5 and 5.5 I'd be very grateful; I'm a Mac user and at the moment have very limited PC access. It works fine on all the main Mac browsers and (I believe) on Wintel IE6. The CSS is coming in via @import so very old browsers won't see it.
CSS:
div.menu {
width: 150px;
float: right; }div.content {
margin-right: 175px; }
HTML:
<html><body><div class="masthead">
Full-width site headline
</div><div class="menu">
<ul>Menu items in right column...</ul>
</div><div class="content">
Main page content in left column...
</div></body></html>
Couple of minor things:
* depending on the look you want you might want to use * {padding: 0; margin: 0;} then explicitly set as required. If not zeroed there is not only a space all around the page but: all but NN float menu tight to bottom of masthead but leave space (varying to about 10px) between content and bottom of masthead. NN7.x also leaves that space between floated menu and masthead bottom.
* re: @import:
@import "test.css"; works for all above.
@import"test.css"; does not work for IE5.x - defaults to no styling.
I hadn't realized there was variation in the @import syntax. What I have been using is:
@import url("/rjo.css");
Is this form read correctly by IE5.x? (Amazingly, there seems to be something wrong with the W3C site at the moment and I can't check the specifications; w3.org is giving me a 403 error.)
body, fieldset, legend, ul, ol, th, td {
padding: 0;
}
If you use a wildcard it trashes <select>s in Firefox/Mozilla. If you check out forms.css in Firefox's /res/ directory, you can see that <option>s and <option>s descended from <optgroup>s are created using default padding. It's a lot easier to not change things than try to put the defaults back without affecting other browsers.
depending on the look you want you might want to use * {padding: 0; margin: 0;} then explicitly set as required
Beginning any large design task by setting margins and padding on all elements to 0 is good advice in almost all circumstances (however you do it). Lots of minor display problems can be traced to a default (un-set) margin or padding value popping up somewhere in the cascade. This was a lesson I learned from the great Todd Fahrner, who did some beautiful early analysis with CSS 1.x as well as the background work for the overall W3C default stylesheet [w3.org].
The CSS validator always kicks out warnings if you have set a color with no background-color, and vice versa; I think it should also kick out a warning when you've set margins or padding alone, but not both.
(Still hacking away at my two-column redesign. Many thanks to iamlost and jetboy for useful links.)
RJO