Image / Text Replacement - Clickable


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

[via rtcrm]

Image/Text replacement for clickable image. This is useful for logo images.


Copy this code and paste it in your HTML
  1. <h1>
  2. <a href="/">RTC<em>RM</em></a>
  3. </h1>
  4.  
  5. h1 {
  6. font properties here
  7. }
  8.  
  9. h1 a { // This can be any inline element: span, strong, em, etc.
  10. display: block; // This forces the <a> element to be as wide as the containing <h1>
  11. width: XXXpx;
  12. height: XXXpx;
  13. background: url('../img/logo.gif') no-repeat 0 0;
  14. overflow: hidden;
  15. text-indent: -9999px;
  16. }
  17.  
  18. /* Example from header on 2008 RTCRM public site */

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.