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>&</test> > > test:contains('&'){ background:red } & 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: <test>&amp;</test> -- Lachlan Hunt http://www.lachy.id.au/ lachlan.hunt@lachy.id.auReceived 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