W3C home > Mailing lists > Public > www-style@w3.org > August 2004

Re: [css3-background] background-position

From: Anne van Kesteren <fora@annevankesteren.nl>
Date: Sat, 28 Aug 2004 19:39:07 +0200
Message-ID: <4130C33B.8000805@annevankesteren.nl>
To: Ian Hickson <ian@hixie.ch>
CC: W3C CSS List <www-style@w3.org>

>> Can 'background-position' become a shorthand? Each value could be 
>> specified by a single property: 'background-position-x' and 
>> 'background-position-y'.
> 
> Why?

In cases you only need to change one. See:

  <http://www.nundroo.com/nav_matrix/welcome2.html>
  <http://www.nundroo.com/nav_matrix/style2.css>

Simple example:

   /* ... */
   ul#nav a{
    background:url(/images/navigation.png);
   }
   /* ... */
   ul#nav li#media a:link{
    background-position:0 -240px;
   }
   ul#nav li#media a:visited{
    background-position:-120px -240px;
   }
   ul#nav li#media a:link:hover{
    background-position:-240px -240px;
   }
   ul#nav li#media a:visited:hover{
    background-position:-360px -240px;
   }
   /* ... */

This list goes on with similar selectors, but slightly different:

   ul#nav li#news a:link{
    background-position:0 -120px;
   }

Only changing one of the two values would be very helpful and make it
the code easier to edit.


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>
Received on Saturday, 28 August 2004 17:39:28 GMT

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