W3C home > Mailing lists > Public > www-style@w3.org > February 2005


From: Anne van Kesteren <fora@annevankesteren.nl>
Date: Fri, 11 Feb 2005 16:36:21 +0100
Message-ID: <420CD0F5.90909@annevankesteren.nl>
To: Ryan Cannon <ryan@ryancannon.com>
CC: www-style@w3.org

Ryan Cannon wrote:
> Anne van Kesteren wrote:
>> The BODY is just another element. It is not special or anything. 
>> Mozilla's UA style sheet is the same for HTML and XHTML.
> Not precisely. When the document is served as text/html and there is
> no styling for the html element, the body element magically controls
> the viewport background.

No. The 'background' property, when applied to the BODY element (only
when there is no 'background' property applied to the HTML element or it
is, but with a value of 'transparant') is propagated to the *canvas* in
HTML documents.

This is a special behavior for the 'background' property, not for the
BODY element.

> This behavior changes when styling (at least background-color) is
> added to the html element.

Only when that value if not 'transparant' as pointed out above and by
the CSS 2.1 CR specification.

> The behavior is similar in Opera and IE5/Mac (although it cannot
> handle application/xhtml+xml), although Opera does not add the margin
> to the body element.

It adds 'padding'. But that is not a very big deal or so.

> Interestingly, Safari does not treat BODY as just another element
> even when served as application/xhtml+xml. I am not sure how this
> does or does not relate to specifications.

I can not test with Safari at the moment, but if it does not treat the
BODY element like that, please file a bug. Also file a bug if it does
treat the BODY element like that but propagates the 'background'
property to the canvas in XML context.

  Anne van Kesteren
Received on Friday, 11 February 2005 15:36:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:35 GMT