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

Re: [css3-backgrounds] Example XV inconsistent with prose of section 3.6

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 14 Sep 2010 11:32:09 -0700
Message-ID: <4C8FBFA9.1040502@inkedblade.net>
To: Brian Manthos <brianman@microsoft.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Sylvain Galineau <sylvaing@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
On 09/14/2010 02:17 AM, Brian Manthos wrote:
> What does
> 	Background-position: left 17px center;
> serialize out as?
> "left 17px 50%"?
> That seems to collide with
> "If three or four values are given, then each<percentage>  or<length>  represents
> an offset and must be preceded by a keyword, which specifies from which edge the offset is given."
> Or are you saying center sometimes becomes 50% when serialized out, and sometimes doesn't?
> Actually...
> Background-position: center right 15px;
> ...is a better example because with the left example below you can get away with "17px 50%".

Let's take a look at the Computed Value section of the property definition:

It says:

   # If one or two values are specified, for a <length> the absolute length,
   # otherwise a percentage. If three or four values are specified, two
   # pairs of a keyword plus a length or percentage.

Further down the definition of 'center' says:

   # Equivalent to ‘50%’ (‘left 50%’) for the horizontal position if the
   # horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’)
   # for the vertical position if it is.

So your first example would compute to "left 17px top 50%" and
your second example would compute to "right 15px top 50%".

Received on Tuesday, 14 September 2010 18:32:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:47 UTC