2015-04-22 35 views
0

嗨我剛剛開始在Monaca IDE中開發,我似乎無法在我的phonegap應用程序中實現字體。字體未加載Monaca onsen ui

@font-face { 
    font-family: "customfont"; 
    src: url("components/monaca-onsenui/css/font_awesome/fonts/Roboto-Light.ttf") format("opentype"); 
     /* Make sure you defined the correct path, which is related to 
      the location of your file `my_css.css` */ 
    } 
    body { 
     font-family: "customfont"; 
     font-size:30px; 
    } 

這是我想要使用的字體的CSS,並沒有實現......

有人能提供一些線索對此有何看法?

回答

2

您確定網址無誤嗎?字體文件是否正確加載?

下面的代碼應該工作:

@font-face { 
    font-family: 'Roboto'; 
    src: url('https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/roboto/Roboto-Regular.ttf'); 
} 

body { 
    font-family: 'Roboto'; 
    font-size: '30px'; 
} 

http://codepen.io/argelius/pen/XbWzMV

+0

您好我想這和它仍然不工作... –

+0

你在控制檯中得到任何錯誤? –

+0

不,完全沒有。 –