Instead of making every icon an extra request, we've compiled them into a sprite—a bunch of images in one file that uses CSS to position the images with background-position
. This is the same method we use on Twitter.com and it has worked well for us.
Glyphicons has granted us use of the Halflings set in our open-source toolkit so long as we provide a link and credit. Please consider doing the same in your projects.
+With v2.0.0, the <i>
tag is essentially dedicated to iconography. To use the icons, you can place the follow code wherever you like one to appear:
+<i class="chevron-left"></i> ++
There are over 100 classes to choose from for your icons. Just add an <i>
tag with the right class and you're set. You can find the full list in sprites.less or right here in this document.
Icons are great, but where would one use them? Here are a few ideas:
+Essentially, anywhere you can put an <i>
tag, you can put an icon.