我下载了引导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>
其他回答
我遇到了这个问题,它是由变量引起的。更少的文件。重写它以设置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"
下载完整/非定制包从那里的网站和替换您的字体文件与非定制包字体。意志是固定的。
我正在使用Angular2和SCSS,作为一个最佳实践,我复制到我的项目中,只有我正在修改的引导文件从node_modules导入。唯一的问题是glyphicon。 经过多次尝试,我发现对我来说最好的解决方案是复制字体文件到我的项目,并直接设置此路径为$ icon-font-path,如图所示:
检查它是否为glyphicons-halflings-regular。Woff而不是glyphiconshalflings-regular.woff