【问题标题】:Google API font not supported in IE8IE8 不支持 Google API 字体
【发布时间】:2011-12-25 03:46:45
【问题描述】:

我在下面的代码中使用 from 来支持字体,

<link href='http://fonts.googleapis.com/css?family=Open+Sans|Oswald|Play|Numans' rel='stylesheet' type='text/css'>

如果我使用上面的网址,所有浏览器都支持的字体。

    @font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: normal;
  src: local('Oswald '), local('Oswald'), url('http://themes.googleusercontent.com/static/fonts/oswald/v2/-g5pDUSRgvxvOl5u-a_WHw.woff') format('woff');
}
@font-face {
  font-family: 'Numans';
  font-style: normal;
  font-weight: 400;
  src: local('Numans'), local('Numans-Regular'), url('http://themes.googleusercontent.com/static/fonts/numans/v2/H6jkjoZl4TIrPYyjhdoCcw.woff') format('woff');
}
@font-face {
  font-family: 'Play';
  font-style: normal;
  font-weight: normal;
  src: local('Play'), url('http://themes.googleusercontent.com/static/fonts/play/v2/-SXnV4mZjf4oh1IBw13WZw.woff') format('woff');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url('http://themes.googleusercontent.com/static/fonts/opensans/v5/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
}

我将上面的 CSS 代码复制并粘贴到我的 CSS 中以获得字体支持。在 IE8 中单独不支持字体。有什么解决办法吗?

【问题讨论】:

    标签: css google-font-api


    【解决方案1】:

    当您复制 CSS 时它停止工作的原因是 Google 会根据发出请求的用户代理发回不同的 CSS。

    The CSS returned for IE is different 到您复制的 CSS。

    因此,如果您使用的是 Google 网络字体,请按照建议将其与 &lt;link href.. 一起使用。


    如果您想在本地托管字体,请阅读:How to host google web fonts on my own server?

    【讨论】:

      猜你喜欢
      • 2013-05-30
      • 2013-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-16
      • 2023-04-03
      • 2011-08-11
      相关资源
      最近更新 更多