CSS3 :empty selector
Complete CSS Selector Reference Manual
Example
Specify the background color of empty p elements:
p
:empty
{
background:
#ff0000
;
}
Try it »
Definition and Usage
:empty selector selects every element that has no children at all (including text nodes).
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Selector | |||||
|---|---|---|---|---|---|
| :empty | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |