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:
- Google Chrome 1.0
- Edge 12.0
- Firefox 3.5
- Safari 3.1
- Opera 9.5