CSS :first-of-type Pseudo-class
- Previous Page :first-child
- Next Page :focus
- Go to the Previous Level CSS Pseudo-class Reference Manual
Definition and Usage
CSS :first-of-type
Pseudo-classes are used to select the first element of a specified type among a group of sibling elements.
Example
Select and set the style of the first <p> element in a group of sibling elements:
p:first-of-type { background-color: yellow; }
CSS Syntax
:first-of-type { css declarations; }
Technical Details
Version: | CSS3 |
---|
Browser Support
The numbers in the table specify the first browser version to fully support the pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
- Previous Page :first-child
- Next Page :focus
- Go to the Previous Level CSS Pseudo-class Reference Manual