CSS3 :last-of-type selector
Complete CSS Selector Reference Manual
Example
Specify the background color of the last p element of its parent:
p:last-of-type
{
background:#ff0000;
}
Try it »
Definition and Usage
:last-of-type selector matches an element that is the last child of a specific type within its parent.
Tip: It means the same as :nth-last-of-type(1).
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Selector | |||||
|---|---|---|---|---|---|
| :last-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |