我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。
当前回答
我必须创建一些重写条件来允许它们:
RewriteCond %{REQUEST_URI} !(^.+\.ttf)
RewriteCond %{REQUEST_URI} !(^.+\.eot)
RewriteCond %{REQUEST_URI} !(^.+\.svg)
RewriteCond %{REQUEST_URI} !(^.+\.woff)
其他回答
例如,确保你没有过度指定字体族
*{font-family: Verdana;}
将从I元素中删除halflings字体。
这就是为什么图标没有出现在我面前的原因:
* {
arial, sans-serif !important;
}
在我已经删除了我的CSS的这一部分,一切都像它应该工作。重要的是引起麻烦的那个。
正如@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');
}
我遇到了这个问题,它是由变量引起的。更少的文件。重写它以设置icon-font-path值解决了这个问题。
文件结构如下所示:
\Content
\Bootstrap
\Fonts
styles.less
variables.less
添加我自己的变量。在Content的根目录中添加less文件,并在样式中引用它。Less解决了404错误。
变量。不包含:
@icon-font-path: "fonts/";
我从NuGet得到Bootstrap。当我发布我的网站时,符号不起作用。
在我的案例中,我通过将每个字体文件的构建动作设置为“内容”并将其设置为“始终复制”来工作。