title: Is it better to use an IMG element for a header logo or a background image, why?
body: <p>I see all the time websites like stackoverflow for example embed their logo as a background image with a span tag for the text for screen-readers.</p>
  
  <pre><code>&lt;a href="https://stackoverflow.com" class="-logo js-gps-track"&gt;
                      &lt;span class="-img _glyph"&gt;Stack Overflow&lt;/span&gt;
                  &lt;/a&gt;
  </code></pre>
  
  <p><strong>Why do this instead of an img element with alt text?
  Is there some semantic reason? Some accessibility reason? SEO reason?</strong></p>
  
  <p>It's not for styling the fallback text in-case an image doesn't load. You can style alt text...</p>
  
  <p>It's not for performance - because with img's you can use srcset and sizes to provide alternate smaller images, and CSS's only spec that's close to what srcset and sizes does isn't well supported yet.</p>
  
  <p>The only time that I see it making sense is when a spritesheet is being used for a site(like with stack overflow.)</p>
  
  <p>If it's to prevent people from "stealing" the logo, that seems silly, because a simple google search would tell someone how to get the url of a background image. If that were the reasoning, it still seems silly because you could just use <code>pointer-events:none;</code> on the image itself, and set the wrapping link to <code>display:inline-block;</code>, and it'd still be a clickable link, without someone being able to right click and save as.</p>
  
  <p><strong>I'd just like to understand if there's an advantage to doing it.</strong></p>
  
  <p>I googled around but didn't really find any useful information answering why to do it either way.</p>
  
  <p>Someone tagged this as being a duplicate to:
  <a href="https://stackoverflow.com/questions/492809/when-to-use-img-vs-css-background-image">When to use IMG vs. CSS background-image?</a>
  They are not the same question. This is a specific practice and pattern you see on the web, the reasoning behind it can be different.</p>