Style External, PDF, and Mailto links with CSS


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

Style External, PDF, and Mailto links using CSS and a background image. For a great set of icons to choose from visit http://www.famfamfam.com/lab/icons/silk/.


Copy this code and paste it in your HTML
  1. a[href^="http"] {
  2. padding-right: 15px;
  3. background: url(external-image.png) no-repeat center right;
  4. }
  5.  
  6. a[href^="mailto:"] {
  7. padding-right: 15px;
  8. background: url(email.png) no-repeat center right;
  9. }
  10.  
  11. a[href$=".pdf"] {
  12. padding-right: 15px;
  13. background: url(pdf.png) no-repeat center right;
  14. }

URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=4

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.