How to use a CSS background image as a hyperlink
This snippit of HTML and CSS will let you use a background image in CSS and use it as a hyperlink in HTML. Here’s the code.
HTML Code:
<a id="test" href="http://yourlink.com">This will get moved off screen</a>
CSS:
a#test{
display:block;
width:100px;
height: 50px;
background: url(images/yourimage.jpg) no-repeat;
text-indent: -9999px;
}
Many thanks to R1gM for this.
No related posts.
This entry was posted on Wednesday, January 6th, 2010 at 12:58 am and is filed under Hints n' Tips.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Leave a Reply
Hot Topics
- Creating a Drupal 6 custom login form - Step by Step tutorial.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- imagecache wrong path - SOLVED!
- Adobe Contribute CS4 - cannot verify your connection Information.
- Drupal - The selected file... could not be uploaded. Only JPEG, PNG and GIF images are allowed
- IIRF Drupal, WordPress and IIS6 - How to get them working first time - Guaranteed!
- Learning About Drupal
- Wordpress widgets not saving or dragging?
- Feeling sick after watching IMAX - Avatar
- How to take Ownership of a Drive, Folder or File in Windows 7
- 7129/6105195 Edward Leedskalnin's anti-gravity - How he built Coral Castle.
- Why do I need to keep resetting my router?
- IIS and Drupal - Enable Clean URL's
- IIRF Wordpress - URL Rewriting for IIS6.0
- How to not be an idiot online - Online 'Gold Rush' exposed!
- Linkshare scam? Review.
- Windows 7 Problems.
- IE9 is currently in development - but what will the future bring?
- IIS7 - No HTTP redirect icon
- Drupal Gmail Module - Solved.
