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

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.


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.


Received on Monday, 21 April 2008 22:36:34 UTC