W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: a recall for a missing combinator

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 15 Nov 2011 15:49:35 -0800
Message-ID: <4EC2FA8F.4080909@inkedblade.net>
To: www-style@w3.org
On 11/15/2011 12:44 AM, Niels Matthijs wrote:
> *The (partial) solution*
> **
> Translating my need to a practical solution may not be all that easy. The closest I get is looking for the first nested
> instance and target all matches on that level:
> article.product (?) header {Ö}
> This should match the first nested instance of the header, ignoring whatever levels that come in between .product and header,
> but failing to match the header in article.review
> *Problems with the solution above*
> I know this is not a full fix for my problem. If I have <p> elements nested on several levels nested inside the
> article.product I still canít style them differently from the <p> elements inside the article.review. This would call for a
> way where css could define an actual scope. While I think this could be incredibly powerful, itís also destructive in the
> wrong hands.

If I relaxed the restriction on not allowing combinators in :matches() and :not(),
then you could do this:

article.product header:not(article.reviews *) {

That reads as "a header that is a descendant of article.product but is not
a descendant of article.reviews". It would also solve your <p> problem.

article.product p:not(article.reviews p) {

Received on Tuesday, 15 November 2011 23:50:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:07 UTC