W3cubDocs

/CSS

:-moz-only-whitespace

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.

Note: In Selectors Level 4 the :empty selector was changed to act like :-moz-only-whitespace, but no browsers currently support this yet.

The :-moz-only-whitespace CSS pseudo-class 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

Syntax not found in DB!

Example

HTML

<div> </div>

CSS

div {
  border: 4px solid red;
}

:-moz-only-whitespace {
  border-color: lime;
}

Result

Specifications

Briefly defined as :blank in Selectors Level 4, but then the functionality was merged into :empty and :blank redefined to mean empty <input>.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support No No Yes
Yes
See bug 1106296.
Uses the non-standard name: :-moz-only-whitespace
No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No No No Yes
Yes
See bug 1106296.
Uses the non-standard name: :-moz-only-whitespace
No No No

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-only-whitespace