CSS3 :emptySelectors

Complete CSS Selector Reference Manual

Example

Specify the background color of empty p elements:

p:empty { background:#ff0000; }

Try it Yourself »

Definition and Usage

The :empty selector selects every element that has no children (including text nodes).


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Selectors
:empty 4.0 9.0 3.5 3.2 9.6

Complete CSS Selector Reference Manual

other extensions