Bootstrap 3无法正确显示字形 [英] Bootstrap 3 unable to display glyphicon properly
问题描述
我从bootstrap 2.3迁移到bootstrap 3,一切正常。但是当我试图添加一些图标时,图标字体无法正常显示。我试图在这里查看 http://bootply.com/61521 ,只有'.glyphicon-envelope'显示正确。
I am migrating from bootstrap 2.3 to bootstrap 3 and everything works well. But when I tried to add some icons, the icon font doesn't displayed properly. I tried to look over here http://bootply.com/61521 and only '.glyphicon-envelope' was being displayed properly. Others have displayed like 'E001' and so on.
我如何能够解决这个问题?
How can I be able to solve this problem?
推荐答案
确定,我的问题不是回答上面。我有fonts文件夹在与bootstrap css和js文件夹相同的位置(例如/ theme / bootstrap3 / ..),但它是在根中查找字体文件夹(例如/ fonts / glyph .. .woff)
OK, my problem was not answered by the above. I had the fonts folder at the same location as the bootstrap css and js folders (eg /theme/bootstrap3/..), but it was looking for the font folder in the root (eg /fonts/glyph.. .woff)
我的解决方案是将@ icon-font-path变量设置为正确的相对路径:
The solution for me was to set the @icon-font-path variable to the correct relative path:
例如@ icon-font-path:fonts /;
Eg @icon-font-path: "fonts/";
这篇关于Bootstrap 3无法正确显示字形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!