【问题标题】:None of the IE versions load my font files没有任何 IE 版本加载我的字体文件
【发布时间】:2013-11-29 02:01:25
【问题描述】:

我在我的 CSS 中放了下面的字体。

@font-face {
font-family: 'sfnt';
src: url('../sfnt.eot'); /* IE9 Compat Modes */
src: url('../sfnt.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../sfnt.woff') format('woff'), /* Modern Browsers */
url('../sfnt.ttf') format('truetype'); /* Safari, Android, iOS */
font-weight: normal;
font-style: normal;
}

如果我尝试在任何版本的 IE 中打开我的网页,它不会加载我的字体文件。 它适用于 Chrome、Safari、Firefox。

我搜索了 Stack Overflow 中记录的类似问题,并尝试了所有可能的解决方案。似乎没有任何效果。

请告诉我出了什么问题。

谢谢

【问题讨论】:

  • 你用的是什么字体,你从哪里得到的?它是网络字体吗?
  • @Jop 是的,它是一种网络字体。我使用link 来创建我的网络字体。
  • 字体与您的 CSS 文件(或 HTML,如果它是内联文件)所在的目录相关的位置在哪里
  • 您是否检查过页面试图从中加载它们的目录是否与基于该页面的文件夹结构相匹配?
  • @Deryck 我所有的字体都放在 index.html 所在的根目录中。

标签: css internet-explorer font-face


【解决方案1】:

如果您尝试直接访问 .eot 字体的 url,即 http:///sfnt.eot 会发生什么?

【讨论】:

  • 这不是答案,是评论
  • 我只有 48 个声望。我无法发表评论。
【解决方案2】:

你可以尝试使用谷歌字体,兼容性更好,你可以使用谷歌cdn。如果你找不到你的字体,你可以尝试使用 then 的语法。

@font-face {
  font-family: 'Wellfleet';
  font-style: normal;
  font-weight: 400;
  src: local('Wellfleet'), local('Wellfleet-Regular'), url(http://themes.googleusercontent.com/static/fonts/wellfleet/v1/qu15OBOh_Q0T8ooRUaKSDT8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}

Google Fonts API 与以下浏览器兼容:

    Google Chrome: version 4.249.4+
    Mozilla Firefox: version: 3.5+
    Apple Safari: version 3.1+
    Opera: version 10.5+
    Microsoft Internet Explorer: version 6+

通过https://developers.google.com/fonts/faq

【讨论】:

    猜你喜欢
    • 2017-06-12
    • 2016-01-02
    • 1970-01-01
    • 2014-07-27
    • 2015-06-17
    • 2021-08-13
    • 1970-01-01
    • 2020-04-16
    • 2013-11-08
    相关资源
    最近更新 更多