Posted By

adamcoulombe on 10/09/09


Tagged

css image html text indent seo sifr


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

scott2b
aleksanderek
loftninja


Replace HTML text with image using only CSS


 / Published in: CSS
 

This is handy for cleaning up your HTML to use more plain text and fewer img tags. Whether this is SEO friendly or not is subjective. I tend to think it's fine as long as you don't use it for spam. Digg implements a similar method for their main logo.

  1. #myLogo {
  2. display:block;
  3. width:135px; /* change to your image width */
  4. height:35px; /* change to your image height */
  5. background:url(myLogo.gif) no-repeat;
  6. text-indent:-9999px;
  7. }
  8.  
  9.  
  10. /* in your HTML:
  11.  
  12. <h1 id="myLogo">My Company Name</h1>
  13.  
  14. */

Report this snippet  

You need to login to post a comment.