2013-05-11 89 views
2

为什么font-awesome可以在localhost上使用,但不能在web上使用?为什么font-awesome不能在Web上工作并在localhost中工作?

请帮忙!!

@font-face { 
    font-family: 'FontAwesome'; 
    src: url('font/[email protected]=3.0.1'); 
    src: url('font/[email protected]#iefix&v=3.0.1') format('embedded-opentype'), 
    url('font/[email protected]=3.0.1') format('woff'), 
    url('font/[email protected]=3.0.1') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
} 
+0

您是否检查文件名中的大小写,Linux区分大小写。 – 2013-05-11 12:14:26

+0

是的,我检查了它。我正在使用Windows服务器 – 2013-05-11 12:36:41

+0

你确定你已经上传了字体真棒文件? – adrianbanks 2013-05-11 22:04:41

回答

0

我从来没有见过使用@这样的标志。尝试使用问号在他们的地方:

@font-face { 
    font-family: 'FontAwesome'; 
    src: url('font/fontawesome-webfont.eot?v=3.0.1'); 
    src: url('font/fontawesome-webfont.eot?v=3.0.1#iefix') format('embedded-opentype'), 
    url('font/fontawesome-webfont.woff?v=3.0.1') format('woff'), 
    url('font/fontawesome-webfont.ttf?v=3.0.1') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
} 

第4行中,我也还交换的#iefixv=3.0.1顺序,并删除了&

+0

仍然不能正常工作 – 2013-05-11 12:34:37

+0

它在localhost上工作,但在web服务器上不工作 – 2013-05-11 12:35:42

1

我从here发现了对此问题的修复: 有人在Thorst页面的一半左右回答了这个问题。

为我节省了大量的挫折!

在情况下,链接进入stale->

改变字体awesome.css

来自:

src: url('../font/fontawesome-webfont.eot?#iefix') format('eot'), 
url('../font/fontawesome-webfont.woff') format('woff'), 
url('../font/fontawesome-webfont.ttf') format('truetype'), 
url('../font/fontawesome-webfont.svg#FontAwesome') format('svg'); 

到:

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'); 

*注意:eot的格式是已更改的内容。

相关问题