我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。


当前回答

您必须按以下顺序设置:

<link rel="stylesheet" href="path/bootstrap.min.css">
 <style type="text/css">
      @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');
}
 </style>

其他回答

另一个问题/解决方案可能是使用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>

之前的答案都不适合我....

问题是我正在尝试<span class="icones glyphicon glyphicon-pen"> 一个小时后,我意识到这个图标不包括在Bootstrap包!而信封图标工作正常..

-如果你选择了评分最高的答案,但仍然不起作用:

字体文件夹必须与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');
}

如果你使用CDN作为引导CSS文件,它可能是罪魁祸首,因为字形文件(例如glyphicons-halflings-regular.woff)也是从CDN中获取的。

以我为例,我使用微软的CDN时遇到了这个问题,但切换到MaxCDN解决了它。

您必须按以下顺序设置:

<link rel="stylesheet" href="path/bootstrap.min.css">
 <style type="text/css">
      @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');
}
 </style>