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

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. }
  6. a[href^="mailto:"] {
  7. padding-right: 15px;
  8. background: url(email.png) no-repeat center right;
  9. }
  11. a[href$=".pdf"] {
  12. padding-right: 15px;
  13. background: url(pdf.png) no-repeat center right;
  14. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.