Genericons Usage

Copy the font folder and the genericons.css file together into your project. Link the CSS in your HTML:

<link href="path/to/genericons.css" rel="stylesheet">

Drop in the following HTML with the name of the icon you want to display:

<div class="genericon genericon-standard"></div>

If you want to insert an icon manually using the :before selector, you can setup CSS rules like the following example. Make sure to set the size to a multiple of 16px or the icons could end up looking fuzzy:

Add a matching class to your HTML:

<div class="my-icon">You're a Star!</div>

Here's the result: You're a Star!

Examples

Turn every icon a Salmon color:

Or turn the stars Gold:

Use icons for bulleted lists:

Use icons to style blockquotes:

Sometimes I've believed as many as six impossible things before breakfast. —Lewis Carroll
`Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"

Use icons to style buttons:

View Listen

/

CSS Preprocessors

Preprocessing extensions such as Sass (SCSS Syntax) or LESS can make it easier to manage CSS for a lot of things at once using things like variables and mixins.

This example will seup the basic genericon rules and sets a color you can use for all icons using Sass:

Here is a similar example for LESS:

Fallback images for IE7 and below

Genericons does not come with fallback icons by default -- therefore you have to create them yourself. If you are using HTML similar to this example:

<span class="genericon genericon-warning"></span>

You can use the asterisk hack to serve a different icon to IE7 once you have saved the fallback icons to your project: