Image Replacement With CSS

If you add this little snippet to your CSS stylesheet you can just apply the class name ir to the element for the image replacement styles to take effect.

      border: 0;
      font: 0/0 a;
      text-shadow: none;
      color: transparent;
      background-color: transparent;

If you want to read more into this new image replacement technique, Nicolas Gallagher has a great post that describes it in great detail – Another CSS Image Replacement Technique

Source: HTML5 Boilerplate

Want to become a better web developer?

Join over 25,000 other developer & designers who get awesome links to the best news and articles each week delivered directly to their inbox.

This post currently has no responses. What do you think?

You can use basic HTML when posting code, please turn all < characters into &lt; or > into &gt;
If the code is multi-line, use <pre><code></code></pre>

Leave a Reply

Your email address will not be published. Required fields are marked *