Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS3 :last-of-type selector

CSS3 :last-of-type selector

Complete CSS SelectorComplete 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

Complete CSS SelectorComplete CSS Selector Reference Manual