W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: [css3-background] background-position relative to other corners

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 21 Apr 2008 15:35:58 -0700
Message-ID: <480D16CE.4030602@inkedblade.net>
To: "Eric A. Meyer" <eric@meyerweb.com>
CC: www-style@w3.org

Eric A. Meyer wrote:
> 
> At 10:03 AM -0700 1/29/08, Alan Gresley wrote:
> 
>> Giving the 'background-origin' property an extra value. This does make 
>> sense.
> 
>    Another possibility is to rename what's now 'background-origin' to 
> 'background-edge' or 'background-bound' (which seems to be what it's 
> really about) and then have a brand-new 'background-origin' that is 
> actually used to define the origin corner.  The horizontal and vertical 
> offset values defined in 'background-position' would then be calculated 
> from the corner defined in 'background-origin', which would default to 
> 'top left' or 'top-left' or whatever.

The disadvantage of this is that it doesn't fall back as nicely. When
the offset and the corner are both specified in 'background-position',
you lose both at the same time rather than keeping the offset, but
offsetting against the wrong corner.

E.g.

background-position: bottom right;
background-position: bottom 10px right 10px;

would fall back to the bottom right corner in older UAs. If you split the
property to

   background-origin: bottom right;
   background-position: 10px 10px;

then the fallback positions the image 10px from the top left corner instead.

I agree the 'background-origin' name isn't very intuitive. Not sure what
would be better, though, given that we also have 'background-clip' which
can be set to a different value.

~fantasai
Received on Monday, 21 April 2008 22:36:34 GMT

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