CSS :first-of-type Pseudo-class
Example
Select and style the first element of type <p>, among a group of sibling elements:
p:first-of-type
{
background-color: yellow;
}
Try it Yourself »
Definition and Usage
The :first-of-type
pseudo-class
selects the first element of its type among a group of sibling elements.
Version: | CSS3 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:first-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
CSS Syntax