CSS :first-of-type Selector

❮ Previous Selectors Next ❯

Example

p:first-of-type {
  color: red;
}

Meaning

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

Note: This is equivalent to :nth-of-type(1).

Version: CSS3




Standard Syntax

:first-of-type {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯