CSS 3 Module <== Test # ==>
W3C Selectors 50 of 182
Testing Date Revision
:only-child pseudo-class (ID #36) 2001-07-11 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>