title: Add content if the element is not empty
body: <p>I want to add content (with :before selector) only if span has value.</p>
  
  <p>If the span is empty I don't want to add content with :before selector.</p>
  
  <p>How can I do it with css?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;style&gt;
      span.b::before {
        content: "\2022"
      }
      
      .span.b:empty {}
    &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;div class="a"&gt;
      &lt;span class="b"&gt;AAA&lt;/span&gt;
    &lt;/div&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>