2013-05-11 44 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的格式是已更改的內容。

相關問題