Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The :-moz-only-whitespace CSS pseudo-class is a Mozilla extension that matches elements that have no child nodes at all, or only have empty text nodes or text nodes that have only whitespace in them.

Syntax

:-moz-only-whitespace

Example

HTML

<span> </span>

CSS

span:-moz-only-whitespace::before {
  background-color: lime;
}

Result

Document Tags and Contributors

 Contributors to this page: mfluehr, Sebastianz, teoli, Sheppy, ethertank, Marsf, Fredchat, Mw22
 Last updated by: mfluehr,