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


当前回答

我正在看我的这个老问题,因为到目前为止应该是正确答案的答案是我在评论中给出的,我认为我也应该为此得到赞扬。

问题在于,从bootstrap的自定义工具下载的字形字体文件与从bootstrap主页上的重定向下载的字体文件不相同。正常工作的是那些可以从以下链接下载的软件:

http://getbootstrap.com/getting-started/#download

任何对旧的糟糕的定制文件有问题的人都应该从上面的链接覆盖字体。

其他回答

读者注意:一定要阅读@user2261073的评论和@Jeff关于定制器中的一个错误的回答。这可能就是你的问题所在。


字体文件没有正确加载。检查文件是否在预期的位置。

@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');
}

正如丹尼尔所指出的,这也可能是一种mimetype问题。Chrome的开发工具显示下载的字体在网络选项卡:

正如@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');
}

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

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

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

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

您必须按以下顺序设置:

<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>