【发布时间】:2015-03-21 07:32:48
【问题描述】:
我在 IE7 中遇到了自定义图标字体包的问题。它根本没有加载。它在 IE8+、FF 和 Chrome 中运行良好。 IE8也使用了eot,所以字体文件本身没有问题。
在网络选项卡上IE11的IE7模式显示根本没有对eot文件的请求(但它在IE8模式下,并且还在虚拟机上尝试了原生IE7)。
我也试过 Fiddler 来检查是否有请求但什么都没有。
我正在使用以下代码嵌入字体:
@font-face {
font-family: "Icons";
src: url("./Icons.eot");
src: url("./Icons.eot?#iefix") format("embedded-opentype"),
url("./Icons.woff") format("woff"),
url("./Icons.ttf") format("truetype"),
url("./Icons.svg#Icons") format("svg");
font-weight: normal;
font-style: normal;
}
我也尝试只专注于 IE7,所以我删除了这些并只使用了这个:
@font-face {
font-family: "Icons";
src: url("./Icons.eot");
font-weight: normal;
font-style: normal;
}
仍然没有成功,Fiddler 仍然没有看到对文件的任何请求。
我使用的是 Nginx 服务器,为 eot 文件添加了以下 MIME 类型:application/vnd.ms-fontobject
另外,即使不是跨域请求,我也肯定添加了Access-Control-Allow-Origin。
任何线索为什么根本没有请求?
【问题讨论】:
-
看看here
-
谢谢,但也试过了 :) 但我现在可以工作了。
标签: css internet-explorer-7 font-face webfonts eot