微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 如何使此Google字体在Internet Explorer 11上运行

我在我的网站上使用蒙特塞拉特字体,但它不显示在IE11( Windows 7)上.我几天前提出这个问题: Montserrat font isn’t displayed on IE 10 and 11

现在我想通过css添加蒙特塞拉特谷歌字体,但它似乎不起作用.这是我的代码

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/montserrat-regular-webfont.eot');
    src: url('assets/fonts/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'),url('assets/fonts/montserrat-regular-webfont.woff2') format('woff2'),url('assets/fonts/montserrat-regular-webfont.woff') format('woff'),url('assets/fonts/montserrat-regular-webfont.ttf') format('truetype'),url('assets/fonts/montserrat-regular-webfont.svg#montserratregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

解决方法

使用:
@import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);

要在样式表中调用它,并且:

font-family: 'Montserrat',sans-serif;

做一些字体..

来自谷歌字体:“注意:为了在IE中获得最佳显示效果,请将样式表标记设置为HTML部分中的第一个元素.在IE中,如果链接放在标记之后,整个页面将被阻止,并且在加载字体之前不会显示任何内容“.

<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

如果这不起作用,请尝试:https://developers.google.com/fonts/docs/webfont_loader#Example

这将使每个浏览器“表现得像Firefox”.

原文地址:https://www.jb51.cc/css/215620.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。