2015-04-22 73 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

不,完全没有。 –