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

查看:167
本文介绍了FontAwesome不会在Firefox中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相关问题。)






PS:IE10正确显示字形


解决方案

你有没有尝试引导CDN ?



只需包括<链接HREF =// netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-在你的< head> 部分中设置awesome.css =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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆