Re: Selector for parent/predecessor?

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 UTC