3 回答

TA贡献1891条经验 获得超3个赞
这篇文章的答案非常有帮助,可以节省大量时间。但是,我发现使用时FontAwesome 4.50,我还必须woff2为扩展名类型添加其他配置,如下所示,否则woff2在Chrome的开发人员工具中的控制台>错误下,对类型的请求给出了404错误。
根据S.Serp的评论,以下配置应放在<system.webServer>标记内。
<staticContent>
<remove fileExtension=".woff" />
<!-- In case IIS already has this mime type -->
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2" />
<!-- In case IIS already has this mime type -->
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
</staticContent>

TA贡献1798条经验 获得超3个赞
实际上,@ Ian Robinson的答案效果很好,但Chrome会继续抱怨该消息:“ 资源被解释为字体,但使用MIME类型application / x-woff进行了传输 ”
如果知道了,可以从
应用/ x-woff
至
应用程序/ x -font -woff
而且您将不再有任何Chrome控制台错误!
- 3 回答
- 0 关注
- 883 浏览
相关问题推荐
添加回答
举报