

Parent Combinator / Parent pseudo-class

From: Stephen <w3mail@jixor.com>
Date: Sat, 19 Jul 2008 18:09:17 +1000
Message-ID: <4881A12D.7070505@jixor.com>
To: www-style@w3.org
For a long time I have hoped for such a thing and still in the css3 
draft there doesn't appear to be any such function.

My concept is that it should be possible to target an element with 
specific children. This would be useful for situations such as:

a:hover < li to target an li element with an a child that has :hover


textarea < div < fieldset to target a fieldset that contains a text area 
inside a div

Obviously the reverse declaration style is odd, however it would seem to 
be less confusing, consider the above written in source order

fieldset < div < textarea would be targeting the first element rather 
than the last.

Another, probably better, option would be to use a pseudo-class:


Or more complex statements may be contained within the with-child 

ul:with-child(ul a:hover) would target a list containing a list with an 
a in :hover state.

At the very least it would make it possible in many situation to reduce 
the use of class and id attributes in your html.
Received on Monday, 21 July 2008 08:07:41 GMT
