W3C home > Mailing lists > Public > www-style@w3.org > September 1999

Minor error in CSS2, section 14.2; 'background'

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Sun, 5 Sep 1999 13:30:06 +0100 (BST)
To: www-style <www-style@w3.org>
Message-ID: <Pine.GSO.4.04.9909051317420.22164-100000@ss1.bath.ac.uk>

The CSS2 spec says, in section 14.2:
# 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.

I believe there is a slight error in this paragraph, in that every
occurance of 'background' should actually read 'background-color'. 

The 'background' property cannot have the value 'transparent', since
it is a shorthand property.

Furthermore, if the BODY background value is used when the HTML
element's 'background[-color]' value is transparent, then you get the
peculiar result that the following:

   HTML { background: url(logo.png) no-repeat top right; }
   BODY { background: white url(paper.png) repeat; }

...would result in no logo.

I suggest that the errata include an item saying that fourth paragraph
should be changed to read:
# 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-color' property for the
# HTML element is different from 'transparent' then use it, else use
# the value of the 'background-color' property for the BODY element.
# If the resulting value is 'transparent', the rendering is undefined.

-- 
Ian Hickson
: Is your JavaScript ready for Nav5 and IE5?
: Get the latest JavaScript client sniffer at 
: http://developer.netscape.com/docs/examples/javascript/browser_type.html
Received on Sunday, 5 September 1999 08:30:10 GMT

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