W3C home > Mailing lists > Public > www-style@w3.org > May 2003

Re: [CSS3] selectors: parent combinator?

From: Michael Day <mikeday@yeslogic.com>
Date: Sun, 4 May 2003 15:17:08 +1000 (EST)
To: patricka@mkdoc.com
Cc: www-style@w3.org
Message-ID: <Pine.LNX.4.44.0305041513001.20970-100000@lorien.yeslogic.com>


> i can't see (with css3 selectors) how to select a paragraph containing,
> say a defining instance of a term.

CSS3 Selectors does not have a parent combinator, although many people 
seem to have suggested such a thing.

Ian Hickson's proposal is probably the closest to what you want:

	p:has(dfn) { ... }

Or I suppose you could be even more precise:

	p:has(dfn:contains("HTML")) { ... }

> is there a way to do this with selectors without changing the example's
> html (i.e. adding class/id attributes on the paragraph)?

No, not with CSS3. Even if there was, you would need a user agent that
supported CSS3 Selectors, such as <plug> YesLogic Prince, a batch
formatter for XML+CSS that supports most of the CSS3 Selectors </plug> :)

Michael Day

YesLogic Pty. Ltd.
Received on Sunday, 4 May 2003 07:29:13 GMT

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