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

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 UTC