CSS 3 Module <== Test # ==>
W3C Selectors 97 of 150 of the static tests category
Testing Date Revision
NEGATED :contains() pseudo-class (ID #85) 2005-09-29 1.2

This paragraph should have a green background.

  • All the text in this list should have a
  • green background throughout as well.
div.stub *:not(:contains("red")) { background-color: lime; }
.red { background-color: red; }
<div class="stub">
  <p class="red">This paragraph should have a green background.</p>
  <ul class="red">
    <li>All the text in this list should have a</li>
    <li>green background throughout as well.</li>
  </ul>
</div>