Replace text with image


/ Published in: CSS
Save to your folder(s)

I did not author this code. I came across it and have found it to be useful.


Copy this code and paste it in your HTML
  1. #ID_OF_ELEMENT {
  2. padding: HEIGHT_OF_IMAGEpx 0 0 0;
  3. overflow: hidden;
  4. background-image: url("hello_world.gif");
  5. background-repeat: no-repeat;
  6.  
  7. height: 0px !important;
  8. height /**/:HEIGHT_OF_IMAGEpx;
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.