CSS :lastoftype Selector (original) (raw)

CSS :last-of-type Selector

Last Updated : 29 Aug, 2024

The ****:last-of-type** Selector is used to target the last child element of the same type of it's parent for styling. This selector is same as ":nth-last-of-type".

**Syntax:

:last-of-type {
//property
}

**Example:

HTML `

I am heading.

I am first child.

I am heading.

I am second child.

I am heading.

I am third child.

I am heading.

I am last child.

I am heading.

`

**Output:

**Supported Browsers: