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


当前回答

它看起来像一个UTF字符问题在你的css。只需更新您的引导css文件与新的。

其他回答

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

* {
    arial, sans-serif !important;
}

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

我有一个盒子宽度代码\e094用于象形文字箭头向下,事实上我解决了在CSS类中添加象形文字的问题:

<i class="glyphicon  glyphicon-arrow-down"></i>

如果它能帮助某人…

我也有类似的问题。 作为一个bootstrap的新手,原来我在图标名称之前缺少了glyphicon关键字。

<span class="glyphicon-search"></span>

应该是

<span class="glyphicon glyphicon-search"></span>

我也遇到了同样的问题,浏览器无法找到字体文件,我的问题是由于我的.htaccess文件中排除了不应该发送到index.php进行处理的白名单文件。由于字体文件无法加载,字符被BLOB替换。

RewriteCond %{REQUEST_URI} !\.(jpg|png|gif|svg|css|js|ico|rss|xml|json)$
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^ index.php [L,QSA]

如您所见,像图像、rss和xml这样的文件被排除在重写之外,但是字体文件是.woff和.woff2文件,因此这些文件也需要添加到白名单中。

RewriteCond %{REQUEST_URI} !\.(jpg|png|gif|svg|css|js|ico|rss|xml|json|woff|woff2)$
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^ index.php [L,QSA]

将woff和woff2添加到白名单中可以加载字体文件,并且字形应该正确显示。

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