CSS3: last-child selector
CSS selectors complete reference manual
Examples
Specify the background color of the parent element in the last p element:
p: last-child
{
background: # ff0000;
}
{
background: # ff0000;
}
try it"
Definition and Usage
: Last-child selector is used to match the last child element of the parent element.
Tip: p: last-child is equivalent to p: nth-last-child ( 1).
Browser Support
Selector | |||||
---|---|---|---|---|---|
: Last-child | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |