【问题标题】:@font-face not working in IE8/9, but works in IE7@font-face 在 IE8/9 中不工作,但在 IE7 中工作
【发布时间】:2012-12-17 09:55:03
【问题描述】:

我正在使用以下 CSS 代码作为自定义字体,基于 Paul Irish 的防弹@font-face 语法:

@font-face {
    font-family: 'TradeGothic';
    src: url('tradegothiclt.eot');
    src: local('☺'),  
        url('tradegothiclt.otf') format('otf'),
        url('tradegothiclt.ttf') format('truetype');
}

由于某种原因,这在 Firefox、Chrome 和 IE7 中完美运行,但在 IE 8/9 中无法运行。任何想法为什么会这样?我尝试了其他字体方法,每次都得到相同的结果。我不知道它是否相关,但这是通过 Wordpress 安装完成的。

【问题讨论】:

    标签: css font-face


    【解决方案1】:

    @font-face 规则移出@media 规则。

    general CSS syntax 规定,at 规则可能只出现在样式表的顶层,而不是嵌套在另一个 at 规则中。 IE 9 似乎强制执行此操作,您还可以使用 W3C CSS Validator 进行检查(当嵌套规则时,它会给出一个模糊的错误消息“解析错误”)。

    【讨论】:

      猜你喜欢
      • 2014-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-12
      • 2019-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多