【问题标题】:HTML5 and @font-face with IE带有 IE 的 HTML5 和 @font-face
【发布时间】:2011-07-20 17:03:27
【问题描述】:

在过去的 2 个小时里,我一直在尝试使用 font-squirrel 的工具包来渲染 @font-face。查看this link,您会发现在所有非 IE 浏览器中一切都很好,但在 IE 中却无法完全呈现...

这是我的字体代码:

@font-face {
    font-family: 'CartoGothicStdBook';
    src: url('../cartogothicstd-book-webfont.eot');
    src: url('../cartogothicstd-book-webfont.eot?#iefix') format('embedded-opentype'),
         url('../cartogothicstd-book-webfont.woff') format('woff'),
         url('../cartogothicstd-book-webfont.ttf') format('truetype'),
         url('../cartogothicstd-book-webfont.svg#cartogothicstdbook') format('svg');
    font-weight: normal;
    font-style: normal;
}

我错过了什么?字体和样式表都在根目录中(尽管我认为这没什么区别)。是不是因为 HTML5 标签(我使用的是 HTML5 shiv)不能使用@font-face pre-IE9?

希望尽快收到绝地编码员的来信,

【问题讨论】:

  • 你在什么标签上使用它?
  • 位于新部分标签内的标题标签。

标签: javascript html fonts css font-face


【解决方案1】:

您是否尝试过使用来自http://www.modernizr.com/ 的 polyfill -modernizer2.js 而不是 html5 shiv。 @font-face 是 Modernizer 检测到的 CSS 功能,请参阅 http://www.modernizr.com/docs/#features-css

【讨论】:

  • 嘿 Leonie,modernizr 将如何帮助实施@font-face 规则?据我所知,modernizr 确定对元素的支持,因为字体从版本 4 开始就被 IE 接受了?
猜你喜欢
  • 2012-08-26
  • 2013-08-12
  • 2012-10-31
  • 2019-01-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-03
相关资源
最近更新 更多