The*_*tor 8 css fonts internet-explorer google-webfonts
我在我的网站上使用蒙特塞拉特字体,但它不显示在IE11(Windows 7)上.几天前我提出了另一个问题:IE 10和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;
}
Run Code Online (Sandbox Code Playgroud)
使用:
@import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
Run Code Online (Sandbox Code Playgroud)
要在样式表中调用它,并且:
font-family: 'Montserrat', sans-serif;
Run Code Online (Sandbox Code Playgroud)
做一些字体..
来自谷歌字体:"注意:为了在IE中获得最佳显示效果,请将样式表标记设置为HTML部分中的第一个元素.在IE中,如果链接放在标记之后,整个页面将被阻止,并且在加载字体之前不显示任何内容".
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
如果这不起作用,请尝试以下操作:https://developers.google.com/fonts/docs/webfont_loader#Example
这将使每个浏览器"表现得像Firefox".
| 归档时间: |
|
| 查看次数: |
35481 次 |
| 最近记录: |