我的字体在 Google 中收到警告:
资源解释为字体,但使用 MIME 类型 application/octet-stream 传输:“.../Content/Fonts/iconFont.ttf”。
即使我有此警告它也有效,但我更愿意避免此警告。
这里是我的报关表:
@font-face {
font-family: 'iconFont';
src: url('../Fonts/iconFont.eot?#iefix') format('embedded-opentype'),
url('../Fonts/iconFont.svg#iconFont') format('image/svg+xml'),
url('../Fonts/iconFont.woff') format('font/x-woff'),
url('../Fonts/iconFont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
我已经搜索过其他帖子,但到目前为止还没有运气。
请注意,我的服务器是 Microsoft 的 IIS。
知道如何避免此警告吗?
Thanks.
您需要将以下类型添加到 .htaccess/IIS:
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
更新了 .woff 类型:
AddType application/x-font-woff .woff
(感谢下面评论中的 @renadeen 指出了这一点。)
在这里查看我对类似问题的回答:字体未加载 https://stackoverflow.com/questions/14287465/font-face-not-loaded/14287894#14287894
摘自这里:Chrome 中的字体问题 https://stackoverflow.com/questions/4051826/font-face-problem-in-chrome.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)