Anchor styling corresponding to href


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



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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.