title: How to prevent showing image alt text if image is loaded using css
body: <p>I am loading an image through css <code>background</code> property , instead of using <code>src</code> attribute. But in that case the <code>alt</code> text is also showing up. How can I stop showing <code>alt</code> text &amp; show it only if image is not loaded</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-css lang-css prettyprint-override"><code>.test {
    display: block;
    width: 200px;
    height: 82px;
    background-size: 200px 82px;
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQJr81CRJeZGFiBsA9_AOyyxegiIPctdcbNfHThnpnclmFH-mJwoQ");
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img class="test" alt="My background image"&gt;</code></pre>
  </div>
  </div>
  </p>