What's new? | Help | Directory | Sign in
Google
             
Search
for
Updated Sep 11, 2008 by pilgrim
Labels: about-css
LastChildCSSPseudoClass  
The :last-child CSS pseudo-class matches any element that is the last child node of its parent.

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


Sign in to add a comment