我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。
当前回答
我也有同样的问题,除了在本页的隐藏评论中,我找不到任何关于它的信息。根据Chrome浏览器,我的字体文件加载正常,但图标显示不正常。我把这个作为答案,希望能帮助到其他人。
我从Bootstrap 3的定制工具下载的字体文件有问题。要获得正确的字体,请访问Bootstrap主页并下载完整的.zip文件。从那里提取四个字体文件到你的字体目录,一切都应该工作。
其他回答
您可以添加这行代码并完成。
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
谢谢。
我遇到了这个问题,它是由变量引起的。更少的文件。重写它以设置icon-font-path值解决了这个问题。
文件结构如下所示:
\Content
\Bootstrap
\Fonts
styles.less
variables.less
添加我自己的变量。在Content的根目录中添加less文件,并在样式中引用它。Less解决了404错误。
变量。不包含:
@icon-font-path: "fonts/";
另一个问题/解决方案可能是使用Bootstrap 2。x代码:
<button class="btn" ng-click="open()"><i class="icon-calendar"></i></button>
当基于指南进行迁移时(。图标-*——> .glyphicon .glyphicon-*):
<button class="btn btn-default" ng-click="open()"><i class="glyphicon-calendar"></i></button>
你忘记添加图标类(包含字体引用):
<button class="btn btn-default" ng-click="open()"><i class="glyphicon glyphicon-calendar"></i></button>
-如果你选择了评分最高的答案,但仍然不起作用:
字体文件夹必须与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');
}
正如@Stijn所描述的,当从Nuget安装这个包时,Bootstrap.css中的默认位置是不正确的。
将此部分更改为如下所示:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('Content/fonts/glyphicons-halflings-regular.eot');
src: url('Content/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded- opentype'), url('Content/fonts/glyphicons-halflings-regular.woff') format('woff'), url('Content/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('Content/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}