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


当前回答

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

文件结构如下所示:

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

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

变量。不包含:

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

其他回答

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

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

我在Eclipse中使用web片段时遇到了这个问题。字体文件被损坏时,包装在web片段jar。 将字体文件复制到使用片段的项目中就可以解决这个问题。

您必须按以下顺序设置:

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

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

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

如果您正在使用CDN,请确保您使用的是最新版本的CDN链接。我正在使用CDN链接的前一个版本,并试图添加更新的图标,我在网站上找到(其中包含最新版本的图标),因此它没有显示在网页上。将cdn链接更改为最新版本可能会有所帮助。