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


当前回答

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

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

其他回答

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

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

如果你使用Visual Studio(2015年,在我的情况下)来创建一个ASP。NET Webforms Web Application,带有Bootstrap主题,默认情况下,字形存储在项目根目录下的/fonts文件夹中。

如果您开始将/Content下的引导文件重新安排到子文件夹中(例如,支持多个主题),那么引导中的所有引用都将引导到../fonts/将中断。您可以将字体文件夹移动到/Content下适当的相对路径,或者重命名从../fonts到/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');
}

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

下载完整/非定制包从那里的网站和替换您的字体文件与非定制包字体。意志是固定的。

我从NuGet得到Bootstrap。当我发布我的网站时,符号不起作用。

在我的案例中,我通过将每个字体文件的构建动作设置为“内容”并将其设置为“始终复制”来工作。