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


当前回答

对我来说有效的是替换以下路线:

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

to

@font-face {
  font-family: 'Glyphicons Halflings';

  src: url('/assets/glyphicons-halflings-regular.eot');
  src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
  url('/assets/fonts/glyphicons-halflings-regular.woff') format('woff'),
  url('/assets/glyphicons-halflings-regular.ttf') format('truetype'),
  url('/assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

其他回答

您必须按以下顺序设置:

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

例如,如果您希望图标为glyphicon-chevron-left

尝试添加class="glyphicon glyphicon-chevron-left"

这就是为什么图标没有出现在我面前的原因:

* {
    arial, sans-serif !important;
}

在我已经删除了我的CSS的这一部分,一切都像它应该工作。重要的是引起麻烦的那个。

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

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

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

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

我遇到了这个问题,它是由变量引起的。更少的文件。重写它以设置icon-font-path值解决了这个问题。

文件结构如下所示:

\Content
        \Bootstrap
        \Fonts
 styles.less
 variables.less

添加我自己的变量。在Content的根目录中添加less文件,并在样式中引用它。Less解决了404错误。

变量。不包含:

@icon-font-path:          "fonts/";