CSS3 :only-of-type selector
Complete CSS Selector Reference Manual
Example
Specify each p element that is the only child of a specific type of its parent::
p
:only-of-type
{
background:
#ff0000
;
}
Try it »
Definition and Usage
:only-of-type represents any element that has no sibling elements of the same type.
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Selector | |||||
|---|---|---|---|---|---|
| :only-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |