Use icon font as a background directly via data attributes in your HTML

This trick was used in the webmix main website, I was looking for a quick way to get personalized headers with an icon as background.
I am using Fontello which I highly recommend since it allows to create custom icon-font libraries, though this trick will work with any icon font system (font awesome, glyphicons, etc.)


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">