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

RE: [css3-background] background-size and background-position

From: Alan Gresley <alan1@azzurum.com>
Date: Fri, 09 Nov 2007 04:09:00 -0700
To: Anne van Kesteren <annevk@opera.com>
cc: www-style@w3.org
Message-ID: <20071109040900.34b83c2f3c9bef00757a2c62c0fb7450.6d5ff8413a.wbe@email.secureserver.net>

Anne van Kesteren wrote:
> Date: Thu, November 08, 2007 6:19 am
> To: www-style@w3.org
> 
> background-position should be defined in such a way that it takes the  
> resulting size of the image into account and not be based on the original  
> size of the image. A line saying that references to the dimensions of the  
> image refer to the size after background-size has been applied would  
> suffice I think. For -o-background-size we currently implement the  
> non-intuitive version and are planning to change this.
> 
> http://www.w3.org/TR/2005/WD-css3-background-20050216
> 
> 
> -- 
> Anne van Kesteren
> <http://annevankesteren.nl/>
> <http://www.opera.com/>

This is something to really look forward to. 

In the use case of a fluid box with auto width and height, can the following positioning be added. It would be useful to be able to position a background image relative in pixels from either the bottom and right edges, as it is currently possible from the top and left edges of an element. For example, if I want to place a background image 10px from both the bottom and right edge or even -10px from both the bottom and right edge, I can not do it. I propose allowing four positions for a position to deal with these situations.

If four percentage or length values are given, the vertical top position comes first, the horizontal right position comes second, the vertical bottom position comes third, and the horizontal right position comes fourth. The only way I can see that this could work is having the non used position values set to auto as below.

background-position:10px 10px /* top left */
or
background-position:10px auto auto 10px /* top left */
background-position:10px 10px auto auto /* top right */
background-position:auto 10px 10px auto /* bottom right */
background-position:auto auto 10px 10px /* bottom left */

Alan Gresley
http://css-class.com/
Received on Friday, 9 November 2007 11:09:17 GMT

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