|
Posted by Harlan Messinger on August 19, 2008, 5:24 pm
Please log in for more thread options
david.karr wrote:
> On Aug 19, 12:12 pm, Harlan Messinger
>> david.karr wrote:
>>> If in my CSS I set the "background-color" property on the "body"
>>> element, it only covers the background of the elements defined in the
>>> body, up to the current width and height of the page. However, if the
>>> current component set has a resulting small height, this leaves most
>>> of the page with the original background color (white).
>> What is "current component set" and what does it mean for it to have a
>> "resulting small height"?
>
> My test page defines two divs, one of which is initially populated,
> and the other is empty. The only populated div is about 100 pixels
> high. The rest of the page is blank. There's a big difference in the
> result between setting background-color on the html element or the
> body element.
>
>>> However, if I set the property on the "html" element instead, it does
>>> color the entire visible page, beyond the current height of all the
>>> components on the page.
>> If the body has a margin, then you certainly do want to color the html
>> unless you want the body's margin to have the browser's default color.
>
> I want to control the background-color on the entire visible page.
>
> Note that when I googled for questions like this, I found statements
> that say it's not recommended to set background-color on the html
> element, as opposed to the body element. They didn't say WHY, however.
I don't know. But if you have margin: 0; for your body then it's six of
one and half a dozen of the other anyway.
|