即使在 localhost 中,我也无法在 firefox 中正确显示 font-awesome。我收到以下跨域错误:
Timestamp: 08/08/2012 02:49:37 PM
Error: downloadable font: download failed (font-family: "FontAwesome" style:normal weight:normal stretch:normal `src index:2): bad URI or cross-site access not allowed
source: http://localhost:3000/djpsite/baseadmin/font/fontawesome-webfont.ttf
Source File: http://localhost:3000/djpsite/baseadmin/css/font-awesome.css
Line: 0
Source Code:
@font-face { font-family: "FontAwesome"; font-style: normal; font-weight: normal; src: url("../font/fontawesome-webfont.eot?#iefix") format("embedded-opentype"), url("../font/fontawesome-webfont.woff") format("woff"), url("../font/fontawesome-webfont.ttf") format("truetype"), url("../font/fontawesome-webfont.svg#FontAwesome") format("svg"); }
我按照这篇文章的建议使用了双引号:firefox @font-face fail with fontawesome但这并没有解决问题。
在 Chrome 中一切正常;有什么建议么?
除了在 Chrome 中解决问题之外,鉴于此限制,我应该如何通过 CDN 出售 font-awesome:http: //dev.w3.org/csswg/css3-fonts/#default-same-origin-restriction?
下面是我的 CSS 文件中的代码:
@font-face {
font-family: 'FontAwesome';
src: url("../font/fontawesome-webfont.eot");
src: url("../font/fontawesome-webfont.eot?#iefix") format('embedded-opentype'),
url("../font/fontawesome-webfont.woff") format('woff'),
url("../font/fontawesome-webfont.ttf") format('truetype'),
url("../font/fontawesome-webfont.svg#FontAwesome") format('svg');
font-weight: normal;
font-style: normal;
}
谢谢你的帮助!