W3C home > Mailing lists > Public > www-style@w3.org > December 1999

Re: Why no Parent Selector?

From: Sjoerd Visscher <sjoerd@heeten.nl>
Date: Mon, 6 Dec 1999 00:42:32 +0100
Message-ID: <002501bf3f7a$66e1d760$1400000a@beneden>
To: "www-style" <www-style@w3.org>
I also have a different solution.

First note that pseudo-elements can only appear once in a selector.
This is because a pseudo-element does not have children or siblings.
(It's not part of the document-tree, it a piece of an element)

So you could use the pseudo-elements to indicate the subject of a
selector. f.e.:

P:before B {content: 'This paragraph contains a bold element'}

would clearly apply to the before pseudo-element of the P element.

Then how can we select P as a whole? We could introduce a new
pseudo-element called :element, but I like an empty pseudo-element
selector better (just an ':')

So.
P: B
would select all P elements containing a B element.

Maybe the : has to be replaced with :: for pseudo-elements,
like Ian suggested. This may add to clarity too.

The use of a subject selector inside () still holds,
but only :: would be allowed, not a real pseudo-element.

Sjoerd Visscher
Received on Sunday, 5 December 1999 18:47:06 GMT

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