Bootstrap 3 Glyphicons are not working

约定不等于承诺〃 2021-11-29 18:48 212阅读 0赞

Bootstrap 3 Glyphicons are not working

解答1

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.

  1. @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

解答2

-If you followed the highest rated answer and it’s still not working:

The Font folder MUST be on the same level as your CSS folder. Fixing the path in bootstrap.css will not work.

Bootstrap.css has to navigate to the Fonts folder exactly like this:

  1. @font-face {
  2. font-family: 'Glyphicons Halflings';
  3. src: url('../fonts/glyphicons-halflings-regular.eot');
  4. 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');
  5. }

转载于:https://www.cnblogs.com/chucklu/p/11082411.html

发表评论

表情:
评论列表 (有 0 条评论,212人围观)

还没有评论,来说两句吧...

相关阅读