我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。
当前回答
我在Eclipse中使用web片段时遇到了这个问题。字体文件被损坏时,包装在web片段jar。 将字体文件复制到使用片段的项目中就可以解决这个问题。
其他回答
我使用VS2015, ASP。NET MVC 6 (RC),并且在生产(在VS(开发)中工作)中gliphicons也有问题(引用的错误消息,图标没有显示)。 原因似乎是,微软cdn页面关闭了(至少现在来自瑞士): http://www.websitedown.info/ajax.aspnetcdn.com
因此(作为临时解决方案),我已经改变了_Layout中的外部引用。cshtml(在环境名称下="Staging,Production")到"internal"引用: 来自:
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css"
to
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"
在此之后,它又可以工作了。
您的字体目录中是否有以下所有文件
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
这是由于bootstrap.css和bootstrap.min.css中的错误编码。当你从定制器下载Bootstrap 3.0时,以下代码是缺失的:
@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');
}
因为这是使用Glyphicons的主要代码,所以它不会在ofc…
从完整的包中下载css文件,这段代码将被实现。
如果你使用CDN作为引导CSS文件,它可能是罪魁祸首,因为字形文件(例如glyphicons-halflings-regular.woff)也是从CDN中获取的。
以我为例,我使用微软的CDN时遇到了这个问题,但切换到MaxCDN解决了它。
IIS默认情况下不会提供。woff文件,所以在IIS中你需要添加一个<mimeMap>条目到你的web。配置文件;
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
</configuration>
推荐文章
- Bootstrap抛出Uncaught错误:Bootstrap的JavaScript需要jQuery
- Twitter Bootstrap 3 Sticky Footer
- 大Glyphicons
- 引导3导航栏崩溃
- 改变引导弹窗的宽度
- 推特引导3.0我如何“徽章徽章重要”现在
- IE8问题推特引导3
- 多模态叠加
- 我如何使象形文字更大?(改变大小?)
- 如何增加列之间的间距?
- ' aria- labels by '和' aria-hidden '是什么属性
- 用Bootstrap 3在AngularJS中表示网格或表格的最佳方法?
- 引导3 jquery事件的活动标签更改
- 引导下拉子菜单缺失
- 引导4 -字形迁移?