W3C home > Mailing lists > Public > www-style@w3.org > September 2006

Re: [css3-selectors] :parent selector

From: David Hyatt <hyatt@apple.com>
Date: Sun, 24 Sep 2006 18:45:15 -0700
Message-Id: <BAB321DA-E95C-4562-8B91-2BC74318885E@apple.com>
Cc: www-style@w3.org
To: fantasai <fantasai.lists@inkedblade.net>

I'd say use a class attribute on your image links and spare yourself  
the lousy page performance of a parent selector. :)  The class  
attribute is so useful at obviating the need for all these fancy  
selectors and will perform better in any modern browser than all  
these more advanced selector alternatives.  Maybe some people view  
this kind of class attribute document pollution as a bad thing, but  
it allows for simpler rule construction and much better performance.

I suppose you might counter that this kind of rule would be useful in  
a user stylesheet, but user stylesheets are only interesting to the  
0.000001% of the browser user population that understand CSS well  
enough to construct and apply them. :)

dave

On Sep 24, 2006, at 5:41 PM, fantasai wrote:

>
> David Hyatt wrote:
>> I have yet to see any compelling use case for a :parent selector  
>> (or for many of the other CSS3 selectors for that matter).
>
> My favorite:
>
>   :link {
>      background: navy;
>      color: white
>      border: outset thin white;
>   }
>
>   /* select links with img child, i.e. all image links */ {
>      background: transparent;
>      border: none;
>   }
>
> ~fantasai
>
>
>
Received on Monday, 25 September 2006 01:45:22 GMT

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