Posted By

paulgrenwood on 09/23/09


css icons

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Attribute-Specific Icons

 / Published in: CSS

CSS Attribute selectors are very powerful giving you many options to control styles of different elements e.g. you can add an icon based on the href attribute of the a tag to let the user know whether link points to an image, pdf, doc file etc.

  1. a[href$='.doc'] {
  2. padding:0 20px 0 0;
  3. background:transparent url(/graphics/icons/doc.gif) no-repeat center right;
  4. }

Report this snippet  

You need to login to post a comment.