CSS 3 Module <== Test # ==>
W3C Selectors 40 of 140 of the static tests category
Testing Date Revision
:only-child pseudo-class (ID #36) 11-july-2001 1.0

This paragraph should have normal background

This div contains only one paragraph

This paragraph should have green background

.red { background-color : red }
p:only-child { background-color : lime }
div.testText > div > p { margin-left : 1em }
<p>This paragraph should have normal background</p>
<div>This div contains only one paragraph
    <p class="red">This paragraph should have green background</p>
</div>