FontAwesome 不显示在 Firefox 中 [英] FontAwesome doesn't display in Firefox
问题描述
相关问题.)
<小时>PS:IE10 正确显示字形.
您是否尝试过 Bootstrap CDN?
只需将 <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
包含在您的 部分.字体文件也会从 CDN 自动加载.
在 Firefox 上检查过,它运行良好.
@Boris 说:
<块引用>Firefox 仅允许在字体所在的服务器发送正确的 CORS 标头的情况下跨域链接字体.
所以很明显,CDN 有责任设置正确的标头,不是你的.他们似乎做对了,因为 Firefox 没有抱怨.
如果您在自己的服务器上托管字体,请记住跨域规则可能仍然适用,例如domain.com
下的字体文件可能无法从 www.domain.com
访问,如果 www.domain.com
没有发送正确的标题.
阅读这个答案,了解绕过跨子域限制的提示- 这可能对您有帮助.
Related question here.
Boris' answer to the above question seems to make sense, but I installed the Font Awesome files on my server and the problem remains:
I looked into the library and found that the font files are included in the install, so the argument about cross-server access to fonts doesn't seem valid. I don't mind using the BootstrapCDN, but then Boris' suggestion seems to apply, and I don't know how to send the right CORS headers. (I tried it, but it doesn't work either.) Any idea how I can fix this, either using the "Bootstrap CDN" or the "default CSS"? (see also these instructions.)
PS: IE10 shows the glyph correctly.
Did you try Bootstrap CDN?
Just include <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
in your <head>
section. Font files will be loaded automatically from CDN, too.
Checked this on Firefox and it works perfectly.
@Boris says:
Firefox only allows cross-domain linking of fonts if the server the font is on sends the right CORS headers.
So it's clear that it's CDNs duty to set the right headers, not yours. And them seem to do that correctly, because Firefox doesn't complain.
If you host fonts on your own server, keep in mind that cross-domain rule may still apply, e.g. font files places under domain.com
may be unaccessible from www.domain.com
, if www.domain.com
doesn't send the right headers.
Read this answer for tips about bypassing cross-sub-domain restrictions - this might help in your case.
这篇关于FontAwesome 不显示在 Firefox 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!