CSS2 Test Suite: 5.11.1 :first-child

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

The style declarations contained within this page:

LI:first-child {color: green;}
P STRONG:first-child {color: green;}
DIV > P:first-child {color: purple;}


The first child element of this paragraph is strongly emphasized text, and should be green, as is also the case for the strongly emphasized text which is the first child of the EM element found here.. The STRONG text in this sentence should NOT be green, since it is not the first child of anything.

In this paragraph, we have some emphasized text, and then a little later, some strongly emphasized text, which should NOT be green, since it is the second child of the paragraph (the EM element is the first).


Within this DIV...

There is a paragraph, and as the first child, it should be purple.

Within this DIV...

An H3 element

There is a paragraph, and as the second child, it should NOT be either purple or green.


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