W3C home > Mailing lists > Public > public-css-testsuite@w3.org > May 2004

Re: [css3-selectors] :contains

From: Lachlan Hunt <lachlan.hunt@iinet.net.au>
Date: Sun, 30 May 2004 22:28:54 +1000
Message-ID: <40B9D386.7040203@iinet.net.au>
To: "Anne van Kesteren (fora)" <fora@annevankesteren.nl>
Cc: W3C CSS List <www-style@w3.org>, public-css-testsuite@w3.org

Anne van Kesteren (fora) wrote:
> I was wondering a bit about ':contains' [1]. What should be the 
> background-color  in the following cases:
>   <test/>
>   test{                   background:red  }
>   test::before{           content:"PASS"  }
>   test:contains('PASS'){  background:lime }

   Content generated with the ::before and ::after pseudo-elements does 
not actually modify the content of the element; only the way it is 
presented, and thus does not affect whether or not another selector 
matches.  The background colour should be red.

> Just to be sure, the following won't match, right?
>   <test>&amp;</test>
>   test:contains('&amp;'){ background:red  }

   &amp; is an HTML/XML entity, not a CSS entity, so it would not be 
converted to an ampersand while parsing the CSS.  Therefore the selector 
would not match your test element.  I expect that it would, however, 
match this:

Lachlan Hunt

Received on Sunday, 30 May 2004 08:29:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:11 UTC