
Signature
Brian
follow the directions in my address to email me
Stephen Poley wrote:
>> It is at least arguable (though not defined anywhere AFAIK) that
>> the topmost element can not meaningfully have a margin. And also
>> arguable that the topmost displayable element is BODY
>>
>> OTOH the CSS spec does include an example where margin is applied
>> to BODY.
> I must say I'm confused by body margins. I think of the viewport as
> the containing box for the body element, so that margin on body has no
> meaning. Am I wrong to think that way?
Taking non-HTML as a starting point, the body is where the content of
the page goes, the page is something beyond it.
Going back to HTML, various browsers that I've played with place the
body within the page. If you use margins and padding, you get the body
with space around it, within the canvas.
Not all browsers handle this sort of thing well, so I give zero padding
and margins to HTML, and put any desired paddings and margins into the
body.
e.g. html {margin: 0; padding: 0;}
body {margin: 0; padding: 1em;}
I'd tend to agree with Stephen; as far as I always understood it, the
browser is only supposed to display what's in the body of the document
(i.e. stuff that's in the wrong place, like in the head, shouldn't show
up), so it doesn't make much sense to display anything more than it
(such as colouring the HTML element around the body element, which is
possible with some browsers).
If you want to check out how some browsers handle margins and padding
with the body or html elements, then give them each different background
colours.

Signature
My "from" address is totally fake. The reply-to address is real, but
may be only temporary. Reply to usenet postings in the same place as
you read the message you're replying to.