2012-01-05 72 views
3

我在我的網站上安裝了兩種Web字體,其中一種正在使用Firefox,而另一種則不是。如果您在Chrome上進行檢查,則兩種Google網絡字體都可以正常工作。 這裏是我的代碼:我的Web字體之一不會在Firefox上呈現

@font-face { 
    font-family: 'UnitSlabProLight'; 
    src: url('/unitslabpro-light-webfont.eot'); 
    src: url('/unitslabpro-light-webfont.eot?#iefix') format('embedded-opentype'), 
     url('/unitslabpro-light-webfont.woff') format('woff'), 
     url('/unitslabpro-light-webfont.ttf') format('truetype'), 
     url('/unitslabpro-light-webfont.svg#UnitSlabProLight') format('svg'); 
    font-weight: normal; 
    font-style: normal; 

} 

@font-face { 
    font-family: 'UnitSlabProBlack'; 
    src: url('/unitslabpro-black-webfont.eot'); 
    src: url('/unitslabpro-black-webfont.eot?#iefix') format('embedded-opentype'), 
     url('/unitslabpro-black-webfont.woff') format('woff'), 
     url('/unitslabpro-black-webfont.ttf') format('truetype'), 
     url('/unitslabpro-black-webfont.svg#UnitSlabProBlack') format('svg'); 
    font-weight: normal; 
    font-style: normal; 

} 

網站是提前任何幫助和解決方案http://www.journeytoearth.com/

感謝。

+0

哪個字體是沒有被呈現? – rebz 2012-01-05 02:11:00

+0

UnitSlabProBlack。 – 2012-01-05 03:20:48

回答

3

它看起來像「UnitSlabProBlack」的@ font-face src屬性是絕對鏈接的,而你的「UnitSlabProLight」src屬性是相對於根的。

我會建議嘗試更改UnitSlabProBlack src格式以匹配「UnitSlabProLight」,因爲那個工程。

它看起來像火狐只接受在src相關鏈接: http://webfonts.info/wiki/index.php?title=%40font-face_support_in_Firefox

http://www.journeytoearth.com/wp-content/themes/melville/style.css

@font-face { 
font-family: 'UnitSlabProLight'; 
src: url('/unitslabpro-light-webfont.eot'); 
src: url('/unitslabpro-light-webfont.eot?#iefix') format('embedded-opentype'), 
    url('/unitslabpro-light-webfont.woff') format('woff'), 
    url('/unitslabpro-light-webfont.ttf') format('truetype'), 
    url('/unitslabpro-light-webfont.svg#UnitSlabProLight') format('svg'); 
font-weight: normal; 
font-style: normal;} 


@font-face { 
font-family: 'UnitSlabProBlack'; 
src: url('http://www.journeytoearth.com/fonts/unitslabpro-black-webfont.eot'); 
src: url('http://www.journeytoearth.com/fonts/unitslabpro-black-webfont.eot?#iefix') format('embedded-opentype'), 
    url('http://www.journeytoearth.com/fonts/unitslabpro-black-webfont.woff') format('woff'), 
    url('http://www.journeytoearth.com/fonts/unitslabpro-black-webfont.ttf') format('truetype'), 
    url('http://www.journeytoearth.com/fonts/unitslabpro-black-webfont.svg#UnitSlabProBlack') format('svg'); 
font-weight: normal; 
font-style: normal;} 
+0

感謝Waynebo的這一建議。不幸的是,我也嘗試過,並沒有奏效。我實際上已經將字體從一個目錄移動到另一個目錄,以測試它是否可行。 UnitSlabProLight適用於任何目錄,但Black不適用。其他解決方案?謝謝。 – 2012-01-05 06:02:06

+0

在傳輸文件和編輯css幾分鐘後,我的webfonts現在可以在FF上工作。無論如何感謝Waynebo的幫助。 – 2012-01-05 07:32:17

+1

感謝Waynebo,Firefox的相對路徑對我的問題做了訣竅。 – 2012-02-08 22:58:41