CSS 如何使此 Google 字体在 Internet Explorer 11 上运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26731808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make this Google Font work on Internet Explorer 11
提问by ThemesCreator
I use Montserrat font on my website, but it doesn't display on IE11 (windows 7). I put this other question some days ago: Montserrat font isn't displayed on IE 10 and 11
我在我的网站上使用 Montserrat 字体,但它不显示在 IE11 (windows 7) 上。几天前我提出了另一个问题:蒙特塞拉特字体未显示在 IE 10 和 11 上
Now i am trying to add Montserrat google font throught the css but it doesn't seems to work. This is my code:
现在我正在尝试通过 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;
}
回答by Refilon
Use:
用:
@import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
To call it inside your stylesheet and:
要在样式表中调用它,并且:
font-family: 'Montserrat', sans-serif;
To make something that font..
制作那种字体的东西..
From google fonts: "Note: For best display in IE, make the stylesheet tag the first element in the HTML section. In IE, if the link is placed after tags, the entire page will block and not display anything until the font is loaded."
来自谷歌字体:“注意:为了在 IE 中获得最佳显示效果,请将样式表标签设为 HTML 部分中的第一个元素。在 IE 中,如果链接放置在标签之后,则整个页面将被阻止并且在加载字体之前不显示任何内容.”
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
If that does not work, try this: https://developers.google.com/fonts/docs/webfont_loader#Example
如果这不起作用,请尝试以下操作:https: //developers.google.com/fonts/docs/webfont_loader#Example
This will make every browser "behave like Firefox".
这将使每个浏览器“表现得像 Firefox”。