CSS3: first-of-type selector
CSS selectors complete reference manual
Examples
Specifies the background color of the first p element of its parent:
p: first-of-type
{
background: # ff0000;
}
{
background: # ff0000;
}
try it"
Definition and Usage
: First-of-type selector matches the element is the parent element of a specific type of the first child.
Tip: and: nth-of-type (1 ) is a meaning.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
:first-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |