Google 网络字体无法在 FF 4.0 或 IE9 中加载
我在 WordPress 主题中使用 Google Web Fonts API,并偶然发现了一个奇怪的问题:字体无法在 FF4 或 IE9 中加载(在 Safari、Chrome、Opera 和 IE8 中没问题......)。
我检查了页面的源代码,以及创建 Google Fonts 样式表链接的 PHP 代码,一切正常 - 链接已创建:
<link rel='stylesheet' id='webfont-body-css' href='http://fonts.googleapis.com/css?family=PT+Sans&ver=3.1.2' type='text/css' media='all' />
<link rel='stylesheet' id='webfont-head-css' href='http://fonts.googleapis.com/css?family=Gruppo&ver=3.1.2' type='text/css' media='all' />
并且样式也已应用:
<style type='text/css'>
body, input, textarea { font-family: 'PT Sans', 'Helvetica Neue' Arial, sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: 'Gruppo', 'Helvetica Neue' Arial, sans-serif; letter-spacing: normal; }
</style>
它在其他浏览器中工作正常,但 FF4 和IE9 有问题,完全忽略 Google 字体。
以下是相关网站/主题的链接:http://dev.gentlecode.net/agency
I'm using Google Web Fonts API in my WordPress theme and stumbled upon a weird problem: fonts don't load in FF4 or IE9 (it's fine in Safari, Chrome, Opera, and IE8...).
I checked the source of the page, as well as the PHP code that creates the links to Google Fonts stylesheets and everything works fine - the links are created:
<link rel='stylesheet' id='webfont-body-css' href='http://fonts.googleapis.com/css?family=PT+Sans&ver=3.1.2' type='text/css' media='all' />
<link rel='stylesheet' id='webfont-head-css' href='http://fonts.googleapis.com/css?family=Gruppo&ver=3.1.2' type='text/css' media='all' />
and the styles are applied as well:
<style type='text/css'>
body, input, textarea { font-family: 'PT Sans', 'Helvetica Neue' Arial, sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: 'Gruppo', 'Helvetica Neue' Arial, sans-serif; letter-spacing: normal; }
</style>
It works fine in other browsers, but FF4 and IE9 have a problem with it and completely ignore the Google Fonts.
Here's the link to the site/theme in question: http://dev.gentlecode.net/agency
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看问题中的 CSS,它在
'Helvetica Neue'
后面缺少一个逗号。Look at your CSS in the question, it's missing a comma after
'Helvetica Neue'
.好吧,它的替代方案也可能是 fontsquirrel =)
well, an alternative to it would also be maybe fontsquirrel =)