Usage<!-- HTML -->
<div>
<p>Not the last child</p>
<p>Not the last child</p>
<p>This is the last child, and will have a green background</p>
</div>
/* CSS */
p:last-child {
background: green;
}Browser compatibility| Test | IE8 | IE7 | FF3 | FF2 | Saf3 | Opera9.5 |
Further reading
|