【问题标题】:Custom Google Font in Internet Explorer 8+Internet Explorer 8+ 中的自定义 Google 字体
【发布时间】:2013-05-11 10:31:07
【问题描述】:

我想在我的网站中使用一种自定义字体,名为“Source Sans Pro”,来自 Google Fonts。它适用于其他浏览器,如 Chrome、Opera、Mozilla 和 Safari……但不适用于 IE。我尝试了一些方法来修复它,但没有成功。一个奇怪的情况,因为几个月前我在其他网站上解决了它,但我不记得如何了。有人可以帮帮我吗?

PS:对不起,英语不是我的母语。

--

所以,我找到了解决方案。自定义字体(在这种情况下为 IE)仅适用于在线网站,而不适用于 localhost。感谢大家的帮助。

【问题讨论】:

  • stackoverflow.com/questions/3694060/… 回答者建议某些谷歌字体,即使经过明显的修复,仍然无法在 IE 中使用。改用他的替代品。
  • 三种添加字体的方法都试过了吗?标准 @import Javascript
  • 感谢 adaam,但没有结果。 @Ma9ic,哪三种方法?

标签: css internet-explorer fonts


【解决方案1】:

这三种方法你都试过了吗?

标准:

<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>

@import:

@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);

Javascript

<script type="text/javascript">
  WebFontConfig = {
    google: { families: [ 'Source+Sans+Pro::latin' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
  })(); </script>

http://www.google.com/fonts#UsePlace:use/Collection:Source+Sans+Pro

【讨论】:

猜你喜欢
  • 2017-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-14
  • 1970-01-01
  • 2013-01-31
  • 2011-06-10
  • 2011-05-03
相关资源
最近更新 更多