我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。
当前回答
这就是在引导3中包含图标的方式
<span class="glyphicon glyphicon-bell"></span>
http://glyphicons.bootstrapcheatsheets.com/
希望这能有所帮助。
其他回答
-如果你选择了评分最高的答案,但仍然不起作用:
字体文件夹必须与CSS文件夹在同一级别。修复bootstrap.css中的路径将不起作用。
Bootstrap.css必须像这样导航到Fonts文件夹:
@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');
}
例如,如果您希望图标为glyphicon-chevron-left
尝试添加class="glyphicon glyphicon-chevron-left"
它看起来像一个UTF字符问题在你的css。只需更新您的引导css文件与新的。
我正在使用Angular2和SCSS,作为一个最佳实践,我复制到我的项目中,只有我正在修改的引导文件从node_modules导入。唯一的问题是glyphicon。 经过多次尝试,我发现对我来说最好的解决方案是复制字体文件到我的项目,并直接设置此路径为$ icon-font-path,如图所示:
例如,确保你没有过度指定字体族
*{font-family: Verdana;}
将从I元素中删除halflings字体。