Oct
09
2008

Attach Icons to Links Automatically

This little CSS code snippet allows you to automatically attach an icon to file downloads. For instance if you had a file to download a pdf it would automatically add the icon to the right of the link.

<a href="news/issue12.pdf">View Latest Issue</a>
a[href $='.pdf'] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}

Result

View Latest Issue

Written by Pete in: css |

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes