【问题标题】:IE7 not loading eot webfontIE7不加载eot webfont
【发布时间】: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


【解决方案1】:

我决定采用“FontAwesome 方式”。我用 CSS 表达式创建了一个单独的 IE7 样式表。

.icon-caret-down {
    font-family: "Icons";
    *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');
    font-style: normal;
}

【讨论】:

    猜你喜欢
    • 2021-08-02
    • 1970-01-01
    • 2012-11-17
    • 2013-01-08
    • 1970-01-01
    • 1970-01-01
    • 2012-03-26
    • 1970-01-01
    • 2014-07-23
    相关资源
    最近更新 更多