【问题标题】:Font not loading in IE 9 [duplicate]IE 9中未加载字体[重复]
【发布时间】:2014-07-02 18:50:01
【问题描述】:

在我的 CSS 样式表中,第一个条目是

@font-face {
    font-family: "Font";
    src: url(link) format("truetype");
}
p.customfont { 
    font-family: "Font", Verdana, Tahoma;
}

这不是计算机上通常安装的字体。 Chrome 会加载此字体并在正确的位置使用它,但 IE 9 不会。现在很多人还在用IE,这让我很担心。我在很多其他电脑上试过,chrome 在所有电脑上都可以正常工作,但 IE 也无法正常工作。

我该如何解决这个问题?

编辑:供将来参考 - http://everythingfonts.com/font-face 为您将 ttf 转换为所需的所有格式,并创建 css - 因此节省了大量时间

【问题讨论】:

  • “很多人还在使用 IE”——你这么说就像 IE 是一个垂死的品种。
  • 使用eotwoff 文件格式!您可以为此使用在线转换器。
  • @NiettheDarkAbsol 对我来说 - 我讨厌它 - 有太多糟糕的经历(包括这个)
  • @CalvT 奇怪的是,我对它的体验没有不好。也许是因为我的计划一直是“在 IE 中工作,不要使用 hax,它会在所有其他浏览器中工作”。可悲的是,这不再是真的 - 对 Firefox 的怒视-

标签: html css internet-explorer google-chrome font-face


【解决方案1】:

一般你应该使用eot、woff、ttf和svg来支持所有的浏览器。

例子:

@font-face {
font-family: 'font';
src: url('../fonts/font.eot'); /* IE9 Compat Modes */
src: url('../fonts/font.eot') format('embedded-opentype'), /* IE6-IE8 */
     url('../fonts/font.woff') format('woff'), /* Modern Browsers */
     url('../fonts/font.ttf') format('truetype'), /* Safari, Android, iOS */
     url('../fonts/font.svg#PlanerRegular') format('svg'); /* Legacy iOS */
}

【讨论】:

    猜你喜欢
    • 2016-11-20
    • 2013-07-29
    • 2012-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-04
    相关资源
    最近更新 更多