W3C home > Mailing lists > Public > www-style@w3.org > March 2010

[css21][css3-background] background-position examples conflict with prose/grammar

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Thu, 4 Mar 2010 23:51:25 +0000
To: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
CC: Brian Manthos <brianman@microsoft.com>, Prabs Chawla <pchawla@microsoft.com>, Arron Eicholz <Arron.Eicholz@microsoft.com>
Message-ID: <045A765940533D4CA4933A4A7E32597E10D6D96F@TK5EX14MBXC111.redmond.corp.microsoft.com>
Per the grammar definition and prose of section 3.6[1], the horizontal component of the offset must come before the vertical one when both are specified. 

"If two values are given and at least one value is not a keyword, then the first value represents the horizontal position (or offset) and the second represents the vertical position (or offset)."

This is reflected in all the declarations of Example VIII.

Example X, however, switches this order in the second background shorthand declaration:

	body { background: url("banner.jpeg") top center }   /*  50%   0% */

This is most like because the example was copied from CSS2.1[2] where the grammar spec seems to allow that top comes before center while the prose is as above. 

In section 3.10[3], background shorthand's Example XVI, the vertical component also comes first:

	E { background: #CCC top left url("metal.jpg") / 100% auto no-repeat}

Errors or misread ?

[1] http://dev.w3.org/csswg/css3-background/#the-background-position
[2] http://www.w3.org/TR/CSS21/colors.html#background-properties
[3] http://dev.w3.org/csswg/css3-background/#the-background
Received on Thursday, 4 March 2010 23:52:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:43 UTC