FontAwesome不会在Firefox中显示 [英] FontAwesome doesn't display in Firefox






你有没有尝试引导CDN ?

只需包括<链接HREF =//在你的< head> 部分中设置awesome.css =stylesheet> 字体文件也将从CDN自动加载。




所以很明显,它是 CDN责任来设置正确的标题,不是你的。他们似乎这样做是正确的,因为Firefox不会抱怨。

如果您在自己的服务器上托管字体,请记住,跨域规则可能仍然适用,例如 中的字体文件可能无法从 访问,如果 不会发送正确的标题。

阅读此答案,以获得有关绕过跨子域限制的提示 - 这可能有助于您的情况。

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="//" 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 may be unaccessible from, if doesn't send the right headers.

Read this answer for tips about bypassing cross-sub-domain restrictions - this might help in your case.


登录 关闭
发送“验证码”获取 | 15天全站免登陆