【问题标题】:Ie8 not rendering embedded fonts to dynamic divsie8 不将嵌入字体渲染到动态 div
【发布时间】:2013-03-11 18:29:59
【问题描述】:
 @font-face {
    font-family: "England Hand";
    src:  url("fonts/englandhand.eot?#iefix") format("embedded-opentype"),url("fonts/englandhand.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

我有上面的字体样式。它包含在页面的正文中。我还没有将字体系列添加到 div 中,它在那里呈现哦。当我创建这个 div 的克隆并为其分配另一个位置和 id 时,字体停止渲染。

控制台也没有错误。此错误仅在 IE 8 上发生,在 IE 9 上运行良好。

解决方案 注意 js 错误。肯定会有一个导致问题的地方

【问题讨论】:

  • CSS 样式实际上不应该在 BODY 标记中声明。最佳做法是在您的 HEAD 标记中链接到外部样式表,或者将带有 STYLE 标记的 CSS 放在页面的 HEAD 中。
  • 是的,我知道,但在这里的一些问题上,我读到这有助于 IE8 正确呈现。好吧,我正在尽我所能。

标签: html css internet-explorer font-face embedded-fonts


【解决方案1】:

我认为您缺少一些支持 ie8/ie9 的前缀。您的代码需要如下所示:

@font-face {
    font-family: 'deutsch_gothicnormal';
    src: url('deutsch-webfont.eot');
    src: url('deutsch-webfont.eot?#iefix') format('embedded-opentype'),
         url('deutsch-webfont.woff') format('woff'),
         url('deutsch-webfont.ttf') format('truetype'),
         url('deutsch-webfont.svg#deutsch_gothicnormal') format('svg');
    font-weight: normal;
    font-style: normal;

}

【讨论】:

  • src: url('deutsch-webfont.eot');是ie9支持的代码。而 nect 线定义了敌人 ie8 所以对于 ie8 我的@font-face 是正确的。
猜你喜欢
  • 2013-02-09
  • 2021-02-07
  • 2014-02-10
  • 1970-01-01
  • 1970-01-01
  • 2021-11-12
  • 1970-01-01
  • 1970-01-01
  • 2012-11-01
相关资源
最近更新 更多