Forum Moderators: not2easy
html, body {
background-color:#f0f8ff;
color:#000;
border:1px solid #699;
max-width:1020px;
margin:0;
padding:0;
}
[w3.org ]
For HTML documents, however, we recommend that authors specify the background for the BODY element rather than the HTML element. User agents should observe the following precedence rules to fill in the background: if the value of the 'background' property for the HTML element is different from 'transparent' then use it, else use the value of the 'background' property for the BODY element. If the resulting value is 'transparent', the rendering is undefined.
CSS 2.1 is identical except that it adds the following sentence:
[w3.org ]
This does not apply to XHTML documents.
So FF appears to be following the specs: The default is background-color: transparent;. If you specify a colour for <body> but not <html> use the <body> colour value for both. This has the intewresting result you mention when <html> and <body> dimensions differ. If both <html> and <body> are left default most browsers show the "undefined" background as white (but it is not specified that it be so).
The solution is to colour each separately:
html {width: 100%; height: 100%; background-color: #f0f;
}
body {max-width: 600px; /* for test on smaller screen */ height: 100%; /* to display for test purposes */ padding: 0; margin: 0 auto; border: 1px solid #699; background-color: #f0f8ff;
}