CSS2 Test Suite: 5.6 Child Selectors

[index page] [section] [Previous] [Next] [Specification]

The style declarations contained within this page:

BODY > P {color: green;}
BODY>P.cl1 {font-family: sans-serif;}
DIV OL > LI STRONG {color: green;}

This paragraph, as a direct child of the BODY, should be green.

[cl1] This paragraph, as a direct child of the BODY and bearing a class of 'cl1', should be green and in a sans-serif font.

This paragraph, which is a child of a DIV, should NOT be green.

  1. The STRONG text in this list...
  2. ...should be green, since it is a descendant of an LI which is a child of an OL element that's a descendant of the BODY.
  3. This item contains an unordered list:
    • The STRONG text in this list...
    • ...should be green, since it is also a descendant of an LI which is a child of an OL element that's a descendant of the BODY.
  4. One more list item, just for good measure, containing strongly empahsized text which should be green.

[index page] [section] [Previous] [Next] [Specification]