title: Using CSS to hide <span> elements when they are empty
body: <p>I have this code:</p>
  
  <pre><code>&lt;p class="alert-error"&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I want to change the style of the CSS for "alert-error" when it shows <code>&lt;span&gt;&lt;/span&gt;</code>. The code is being generated by a system with limited backend customization. Sometimes the spans are filled with error messages.</p>
  
  <p>The <code>:empty</code> selector doesn't seem to work cause I have to put it on the <code>alert-error</code> class.</p>
  
  <p>Any help would be appreciated.</p>