2016-02-13 67 views
0

我似乎無法讓@ font-face爲我的網站工作。我不確定我是否正確地做到了這一點。這看起來正確嗎?使用@ font-face時遇到問題

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

@font-face { 
font-family: 'vollkornregular'; 
src: url('../fonts/vollkorn-regular-webfont.eot'); 
src: url('../fonts/vollkorn-regular-webfont.eot?#iefix') format('embedded-opentype'), 
    url('../fonts/vollkorn-regular-webfont.woff2') format('woff2'), 
    url('../fonts/vollkorn-regular-webfont.woff') format('woff'), 
    url('../fonts/vollkorn-regular-webfont.ttf') format('truetype'), 
    url('../fonts/vollkorn-regular-webfont.svg#vollkornregular') format('svg'); 
font-weight: normal; 
font-style: normal;} 
+0

可能的重複http://stackoverflow.com/questions/12589758/font-face-doesnt-work – Microsmsm

+0

你有任何控制檯錯誤? –

+0

不,但它工作正常,即只是不在其他瀏覽器 –

回答

0

@font-face規則通常不支持一些舊的瀏覽器。我通常使用font-face generator,它會從您的字體生成需要包含的css文件,所有瀏覽器都會正確顯示它。

+0

這就是我使用的。它給了我那個代碼。我所做的只是將它指向我的字體所在的文件夾。它只爲ie工作。 –