Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 Glyphicons are not working

I downloaded bootstrap 3.0 and can't get the glyphicons to work. I get some kind of "E003" error. Any ideas why this is happening? I tried both locally and online and I still get the same problem.

like image 312
scooterlord Avatar asked Aug 21 '13 23:08

scooterlord


People also ask

How do I add Glyphicons in Bootstrap 3?

Bootstrap 3 Glyphicons are actually fonts, so you can scale them and color them as you please. Bootstrap previously used image sprites for icons. To add a glyphicon, add a <span> tag with Bootstrap's . glyphicon class and also the class for the specific glyphicon that you require.

What can I use instead of Glyphicons?

Free Alternatives to Glyphicons You can use both Font Awesome and Github Octicons as a free alternative for Glyphicons.

What is the main usage of Glyphicons in bootstrap?

The bootstrap glyphicons are an icon used for form, text, navigation and many other web components. This helps to reduce text and give meaningful information in short.


2 Answers

I was having the same issue and couldn't find any information about it except in the hidden comments on this page. My font files were loading just fine according to Chrome, but the icons weren't displaying properly. I'm making this an answer so it will hopefully help others.

Something was wrong with the font files that I downloaded from Bootstrap 3's customizer tool. To get the correct fonts, go to the Bootstrap homepage and download the full .zip file. Extract the four font files from there to your fonts directory and everything should work.

like image 112
Jeff Avatar answered Sep 24 '22 16:09

Jeff


Note to readers: be sure to read @user2261073's comment and @Jeff's answer concerning a bug in the customizer. It's likely the cause of your problem.


The font file isn't being loaded correctly. Check if the files are in their expected location.

@font-face {   font-family: 'Glyphicons Halflings';   src: url('../fonts/glyphicons-halflings-regular.eot');   src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); } 

As indicated by Daniel, it might also be a mimetype issue. Chrome's dev tools show downloaded fonts in the network tab:

chrome network tab font download

like image 42
user247702 Avatar answered Sep 21 '22 16:09

user247702