Easy Tutorial
❮ Sel Invalid Pr Clip Path ❯

CSS3 :empty Selector

Complete CSS Selector Reference

Example

Specify the background color for empty p elements:

p:empty
{
    background:#ff0000;
}

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.

Selector
:empty 4.0 9.0 3.5 3.2 9.6

Complete CSS Selector Reference

❮ Sel Invalid Pr Clip Path ❯