【问题标题】:@font-face not displaying on Internet Explorer@font-face 不显示在 Internet Explorer 上
【发布时间】:2012-04-26 09:37:23
【问题描述】:

我目前正在使用防弹语法和从 Font-Squirrel 转换的字体作为字体 www.runningwith purpose.org.nz(html中的字体内联css - 工作) www.runningwith purpose.org.nz/broken(css 文件中的字体 - 不工作) . 这两种方法在 IE 以外的浏览器上都可以很好地显示字体,IE 有时会显示部分或全部字体,有时则根本不显示(但通常根本不显示)。 我曾尝试使用“笑脸”语法来处理 htaccess 文件,但都没有奏效。 但是我确实设法修复它,但将字体 css 内联在 html 文件中。 这没关系,但我想知道为什么我似乎无法让它工作,因为许多其他人在 css 文件中都有 @font-face 声明,这会更干净,它曾经对我工作正常,但没有。

考虑到没有其他现有帮助有效,任何有关如何使这项工作的建议都会很棒。

使用的@font-face 声明之一

@font-face {
    font-family: 'Aller-Regular';
    src: url('assets/fonts/aller-regular.eot');
    src: url('assets/fonts/aller-regular.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/aller-regular.woff') format('woff'),
         url('assets/fonts/aller-regular.ttf') format('truetype'),
         url('assets/fonts/aller-regular.svg#Aller-Regular') format('svg');
    font-weight: normal;
    font-style: normal;
}

【问题讨论】:

  • 你在css文件中哪里声明了font-face?在任何其他 css 之前声明它很重要。
  • 在底部,将它放在顶部并没有帮助/改变任何东西。

标签: css internet-explorer font-face


【解决方案1】:

您是否尝试过使用 Google webfont 代替?,我曾经使用 fontface,但发现 Google 字体更容易实现一百万倍,而且用户不必每次都从您的服务器下载字体,它就来了直接来自谷歌。 http://www.google.com/webfonts

【讨论】:

    【解决方案2】:

    正如我的问题中所述,我当时能够通过将@font-face 声明内联在 html 中来修复它。 但现在 IE 似乎已经决定修复自己,让我在 CSS 中声明 @font-faces。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-28
      • 1970-01-01
      • 2011-02-21
      • 2023-03-14
      • 2020-09-07
      • 2011-02-19
      • 2015-07-22
      相关资源
      最近更新 更多