How to make this Google Font work on Internet Explorer 11

我的梦境 提交于 2019-12-23 07:57:25

问题


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

Now i am trying to add Montserrat google font throught the css but it doesn't seems to work. This is my code:

@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:


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."

<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

This will make every browser "behave like Firefox".



来源:https://stackoverflow.com/questions/26731808/how-to-make-this-google-font-work-on-internet-explorer-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!