We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

neal_grosskopf on 12/07/07


Tagged

css CSS3


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

copyleft
SpinZ
aziz
devioustree
stoker
cwoodley
neal_grosskopf


Style Links By File Type


Published in: CSS 


URL: http://nealgrosskopf.com/files/css/style.css

Style external, email, and pdf links using css3 attribute selectors.


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

Report this snippet 

You need to login to post a comment.