【问题标题】:Why is IE8 not loading my eot files?为什么 IE8 不加载我的 eot 文件?
【发布时间】:2012-03-26 12:58:13
【问题描述】:

我下载了一些 otf 字体,然后使用:https://onlinefontconverter.com 将它们转换为 eot,但是当我在 IE8 中查看该站点时,字体不显示(它们在 Chrome、Firefox、Opera、Android 中显示)。我的代码或 eot 一定有问题。有谁知道怎么回事?

(在此处下载 Roboto:http://www.fontsquirrel.com/fonts/roboto

(在此处转换:https://onlinefontconverter.com

STYLES.CSS

@font-face
{
    font-family: RobotoCondensed;
    src: url("Roboto-Condensed.eot");
}

@font-face
{
    font-family: RobotoCondensed;
    src: url("Roboto-Condensed.ttf");
}

.myDiv
{
    font-family: RobotoCondensed, Arial, Helvetica;
    font-size: 10px;
    color: #e8e8e8;
}

index.html(相关代码)

<div class="myDiv">Some font in here that shows incorrectly as Arial!</div>

样式表和字体在同一个文件夹中。

【问题讨论】:

  • 为什么不是font-family = Roboto-Condensed
  • 你可以随意命名。
  • 您是否尝试过使用 Font Squirrel 的字体生成器? fontsquirrel.com/fontface/generator - 为您提供所有浏览器所需的所有字体和 CSS。

标签: html css internet-explorer internet-explorer-8 fonts


【解决方案1】:

试试这个

        @font-face
    {
        font-family: 'RobotoCondensed';
        src: url('Roboto-Condensed.eot');
  src: url('Roboto-Condensed.eot?#iefix') format('embedded-opentype'),
         url('Roboto-Condensed.woff') format('woff'),
         url('Roboto-Condensed.ttf') format('truetype'),
         url('Roboto-Condensed.svg#') format('svg');

}

    .myDiv
    {
        font-family: RobotoCondensed, Arial, Helvetica;
        font-size: 10px;
        color: #e8e8e8;
    }

【讨论】:

    【解决方案2】:

    试试

    font-family: "RobotoCondensed", Arial, Helvetica;
    

    引号应该强制它作为您的主要选择

    【讨论】:

    • 没有。无论您是否使用引号,都不会影响选择这些字体中的哪一种。引号帮助解析器(和普通读者)确定字体名称的确切含义,但是一旦解析了名称,它们的使用方式就没有区别了。
    【解决方案3】:

    感谢所有帮助。看起来问题出在字体转换器上。 eot 文件未被 IE 识别为有效。感谢“Joel Eckroth”建议我尝试其他转换器。

    【讨论】:

      【解决方案4】:
      猜你喜欢
      • 2018-11-05
      • 1970-01-01
      • 2016-03-03
      • 1970-01-01
      • 2015-03-21
      • 2016-12-05
      • 2021-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多