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

Re: Selector for parent/predecessor?

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sun, 20 Aug 2006 12:39:46 +1000
Message-ID: <44E7CB72.40401@lachy.id.au>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
CC: www-style@w3.org

Giuseppe Bilotta wrote:
> in my limited HTML authoring experience I've come across a few
> situations in which I would have liked to have the possibility to
> change the style of an element depending on whether it was the
> /parent/ (or more in general an ancestor) of another element, or to
> select an element because it was /followed/ by a particular sibling.

This has been requested many times before.  Search the archives for 
parent selectors and the :matches() proposal.  IIRC, such proposals get 
rejected because it doesn't fit the CSS processing model and also 
performance issues.

> input[type="radio"] < form:not(input[type="radio"]:checked < form) { ... }

:not() can only contain a simple selector.  In other words, it cannot 
contain any combinators.

e.g.  These are valid:
   :not(foo)
   :not(foo[bar])
   :not(foo:hover)

These are not:
   :not(foo bar)
   :not(foo>bar)
   :not(foo+bar)

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Sunday, 20 August 2006 02:40:04 GMT

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