【发布时间】:2015-10-20 21:28:03
【问题描述】:
我正在尝试在我的网站中使用 Google 字体 Muli。我可以看到字体在 chrome、FF 和 opera 中完美运行。
当我在 IE9、10、11 中打开我的网站时,它根本不使用字体。我尝试了以下方法,但仍然没有运气。
方法一:
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Muli::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>
方法二:
<link href='http://fonts.googleapis.com/css?family=Muli' rel='stylesheet' type='text/css'>
方法三:
@import url(http://fonts.googleapis.com/css?family=Muli);
我发现令人震惊的是,IE 根本没有加载http://fonts.googleapis.com/css?family=Muli url。我尝试在新窗口中加载相同的 url,但它没有响应,但在其他浏览器中也一样。
我需要在 IE 中添加什么内容吗?
【问题讨论】:
-
检查 IE 的控制台。那里有任何错误吗?方法 2 应该可以在 IE11 中运行。
标签: html css internet-explorer fonts google-font-api