2016-09-16 76 views
1

我在一個項目中使用了兩個字體圖標。 Font Awesome和一個自定義SVG字體。所有字體文件都在同一個文件夾中。這裏是文件結構:無法加載字體文件,404錯誤

-assets 
    -css 
     -font-awesome.min.css 
     -themefy.css 
    -fonts 
     -font-awesome.eot 
     -font-awesome.svg 
     -font-awesome.ttf 
     -font-awesome.woff 
     -font-awesome.woff2 
     -font-awesomed41d.eot 
     -themify.eot 
     -themify.svg 
     -themify.ttf 
     -themify.woff 
     -themifyd41d.eot 

兩種字體在本地主機工作正常,但在部署後themify字體不工作。它會在Chrome控制檯中返回一個404 not found。我對它進行了大量的研究2/3天,仍然無法弄清楚是什麼問題。這裏是我的themify @字體面:

themify.css

@font-face { 
    font-family: 'themify'; 
    src:url('../fonts/themify.eot?-fvbane'); 
    src:url('../fonts/themifyd41d.eot?#iefix-fvbane') format('embedded-opentype'), 
     url('../fonts/themify.woff?-fvbane') format('woff'), 
     url('../fonts/themify.ttf?-fvbane') format('truetype'), 
     url('../fonts/themify.svg?-fvbane#themify') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

如果你想現場觀看:http://smartrahat.com/

回答

2

請刪除後綴(-fvbane )從字體CSS可能會造成404這個問題。

+0

是啊!有效!!我之前做過,但那個時候舊的'css'在我的瀏覽器緩存中,所以結果是一樣的。現在它工作正常,非常感謝。 – smartrahat