CSS :first-of-type Selector

The :first-of-type selector in CSS allows you to target the first occurence of an element within its container. It is defined in the CSS Selectors Level 3 spec as a “structural pseudo-class”, meaning it is used to style content based on its relationship with parent and sibling content.

The :first-of-type CSS pseudo-class represents the first element of its type among a group of sibling elements.

The :first-of-type selector will target the first child of the specified element.

Example -