Add icons to files (CSS)
» Articles / Code » HTML/CSS » Add icons to files (CSS)
If you have downloadable files on your site, then it looks much better if these files have an icon next to it that indicates the filetype.
Here’s a usefull CSS trick to show icons for pdf files :
a[href$=".PDF"], a[href$=".pdf"] {
background:transparent url(images/pdf_icon.png) no-repeat scroll left center;
padding:6px 2px 6px 40px;
}
Ofcourse, you should have a image (pdf_icon.png) in your images folder.
You can get the icons here: http://wwwimages.adobe.com/www.adobe.com/lib/com.adobe/template/icon/pdf.gif
Post your comment
Comments
No one has commented on this page yet.
RSS feed for comments on this page | RSS feed for all comments