我们使用 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 */
但这就是奇怪的地方。查看开发人员工具,正在发送对字体的 HTTP 请求,但只接收到几百个字节(可能只是标头)。
但 HTTP 响应将内容长度正确列出为几千字节。
“响应正文”选项卡仅显示“没有可查看的数据”。
您可以在网络面板屏幕截图中看到 Google 字体的行为并非如此。
将 URL 粘贴到地址栏中会导致下载完整文件。
遇到了类似的问题,从上面的屏幕截图来看,响应的 Cache-Control 标头为“no-store”。 IE 似乎存在缓存和字体问题。
删除“Cache-Control: no-store”和“Pragma: no-cache”标头有助于我们让图标字体再次显示。
https://github.com/FortAwesome/Font-Awesome/issues/6454 https://github.com/FortAwesome/Font-Awesome/issues/6454
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)