The*_*uhn 36 css internet-explorer webfonts internet-explorer-11
我们使用icomoon作为我们的图标字体,它们在Chrome和Firefox中运行良好,但不会在IE11中显示......有时候.它似乎适用于第一页加载,但不适用于后续页面加载.清除缓存似乎没有重置它.这个问题可能出现在其他IE版本中,现在我们只关注IE11.
这是我们的@ font-face:
@font-face {
font-family: 'icon';
src:url('fonts/icon.eot?-3q3vo5');
src:url('fonts/icon.eot?#iefix-3q3vo5') format('embedded-opentype'),
url('fonts/icon.woff?-3q3vo5') format('woff'),
url('fonts/icon.ttf?-3q3vo5') format('truetype'),
url('fonts/icon.svg?-3q3vo5#rezku') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-alphabet:before {
content: "\e600";
}
/* etc etc etc */
Run Code Online (Sandbox Code Playgroud)
但这里变得奇怪.查看开发人员工具,正在发送字体的HTTP请求,但只接收了几百个字节(可能只是标题).
但HTTP响应正确地将内容长度列为几千字节.
"响应正文"选项卡只显示"无数据可查看".
您可以在网络面板屏幕截图中看到Google字体的行为不是这样的.
在位置栏中粘贴URL会导致下载完整文件.
tim*_*hin 32
遇到类似的问题,从上面的截图中,响应的Cache-Control标题为"no-store".IE似乎在缓存和字体方面存在问题.
同时删除'Cache-Control:no-store'和"Pragma:no-cache"标题可以让我们再次显示图标字体.
https://github.com/FortAwesome/Font-Awesome/issues/6454
小智 11
在调查了同样的问题,并通过在线发布的各种解决方案后,我创建了以下故障排除列表,其中涵盖了大多数潜在原因:
Cache-Control: no-store, no-cache
或Pragma: no-cache
标题或任何Expires
包含过去日期的标题.另外,Vary
头部有其IE技巧,如果设置为任何以外Accept-Encoding
,User-Agent
,Host
还是Accept-Language
那么IE将不缓存任何东西,除非一个ETAG
头也存在(请参阅此MSDN博客文章).Content-Type: text/plain
为通常的字体类型(eot, woff, woff2
).有关要使用的正确内容类型,请参阅此答案.display: block
或display: inline-block
用于您的图标元素. 归档时间: |
|
查看次数: |
39960 次 |
最近记录: |