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

Re: [css3-background] New use case for background-position-x (&y!)

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 10 Nov 2010 15:23:34 -0800
Message-Id: <31FB5EE4-C274-49FE-AB82-48C23A8AF6FD@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>, "lee.kowalkowski@googlemail.com" <lee.kowalkowski@googlemail.com>
To: Markus Ernst <derernst@gmx.ch>

On Nov 10, 2010, at 8:35 AM, "Markus Ernst" <derernst@gmx.ch> wrote:

> Besides the discussion on image spriting being an appropriate use case or not, I think that Lee's actual request is actually not silly. I share his point that it would be consistent to have the possibility to set background position values separately, but I would consider background-position-top, -right, -bottom, and -left properties more appropriate than -x and -y properties, just as for element position, border and whatever.

I don't know how that would work if there were 4 component lengths in a single declaration. Seems a little more complicated. 

> I do not know whether there are explicit use cases for this, but the background-position property as a shorthand is not really intuitive; I myself have to check a manual every time I need this property, because I always forget the order of the values. So, for some authors, separate properties would make a little thing a little bit easier.

I'm more sympathetic to this line of thought, as I also have to pause to think which dimension comes first (it's the opposite of when you specify two length for, say, margin). However, I think this has already improved a lot in the latest spec, because now you can be very explicit about the edge to measure from. For instance:

background-position: left 10px top 15px;
...means "10px from left, and 15px from the top".  
Received on Wednesday, 10 November 2010 23:24:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:40 UTC