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

时间:2014-11-04 09:36:33

标签: css internet-explorer fonts google-webfonts

我在我的网站上使用蒙特塞拉特字体,但它不显示在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;

}

1 个答案:

答案 0 :(得分:9)

使用:

@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”。