【问题标题】:How to make this Google Font work on Internet Explorer 11如何使此 Google 字体在 Internet Explorer 11 上运行
【发布时间】:2014-12-31 03:30:29
【问题描述】:

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

}

【问题讨论】:

  • 我对这个问题发表评论,我创建了你提到的问题,但现在我正在尝试按照问题答案所说的去做,但我遇到了问题
  • 我知道,但我看不出你的问题有什么不同。抱歉,如果我错过了什么......

标签: css internet-explorer fonts google-webfonts


【解决方案1】:

用途:

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

在样式表中调用它并:

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

制作那种字体的东西..

来自 google fonts:“注意:为了在 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”。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-11-02
  • 1970-01-01
  • 2015-03-09
  • 1970-01-01
  • 2022-11-05
  • 1970-01-01
  • 2013-12-09
  • 1970-01-01
相关资源
最近更新 更多