diTii.com Digital News Hub

Sign up with your email address to be the first to know about latest news and more.

I agree to have my personal information transfered to MailChimp (more information)


Attach icons to anything with CSS

Thanks to CSS selectors it’s possible to attach icons to anything you want just by adding an attribute of your choosing to your HTML. Want a popup icon? try <a href=’#’ icon=’popup’> how about a magnifier? <a href=’#’ icon=’mag’>. You can even add them automatically for file types. For e.g. to attach a pdf icon to the right of any hyperlink who’s URL ended in ‘.pdf’ like:

a[href $='.pdf'] { 
   padding-right: 18px;
   background: transparent url(icon_pdf.gif) no-repeat center right;

Continue reading full article….


HTML, CSS, Selectors, Icons

Share This Story, Choose Your Platform!

Get Latest News

Subscribe to Digital News Hub

Get our daily newsletter about the latest news in the industry.
First Name
Last Name
Email address
Secure and Spam free...