CSS Pseudo-class :empty
This selector selects every element that is 100% empty. Even <p> </p>
isn't empty, because of the whitespace. Note that "empty" elements like img
and input
can't be selected by this pseudo-class.
Examples
Compatibility
Chrome | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|
Any | 1.5+ | Any | 9.5+ | 3.1+ |