2017-07-09 51 views
0

我想在我的Rails應用程序上使用SegoePrint字體。我在app /資產/字體這兩個文件Rails自定義字體不適用於Firefox和IE

SegoePrint.ttf

SegoePrint.eot

在我的樣式表,如果我有

@font-face { 
font-family: "SegoePrint";   
src: url(SegoePrint.ttf) format("truetype"); 
} 

它僅適用於Firefox ,不適用於IE,但如果我有

@font-face { 
font-family: "SegoePrint";   
src: url(SegoePrint.ttf) format("truetype"); 
src: url(SegoePrint.eot); 
src: url(SegoePrint.eot?#iefix) format("embedded-opentype"); 
} 

我只適用於IE,不適用於Firefox。什麼是正確的語法讓它適用於這兩個瀏覽器?謝謝。

回答

0

怎麼樣,如果你使用下面

@font-face { 
    font-family: 'SegoePrint'; 
    src: asset-url('SegoePrint.eot'); 
    src: asset-url('SegoePrint.eot') format('embedded-opentype'), 
     asset-url('SegoePrint.ttf') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
} 
這句法
相關問題