title: CSS selector for empty or whitespace
body: <p>We have a selector <code>:empty</code> that can match an element when it is <strong>completely empty</strong>:</p>
  
  <pre><code>&lt;p&gt;&lt;/p&gt;
  </code></pre>
  
  <p>But I have a condition where it might be empty, or it might contain line breaks or blank spaces:</p>
  
  <pre><code>&lt;p&gt;    &lt;/p&gt;
  </code></pre>
  
  <p>I found a solution for Firefox, <code>:-moz-only-whitespace</code>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>:empty { width: 300px; height: 15px; background: blue; }
  :-moz-only-whitespace { width: 300px; height: 15px; background: orange; }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;&lt;/p&gt;
  &lt;p&gt;    &lt;/p&gt;
  &lt;p&gt;This is paragraph three.&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is there a similar solution for other browsers?</p>
  
  <p>PS: <a href="https://jsfiddle.net/fzax9qj1/" rel="noreferrer">In JSFiddle</a></p>