嗨,我
刚刚开始在Monaca IDE中开发,我似乎无法在我的phonegap应用程序中实现字体。
@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,它没有实现...
有人可以对此有所了解吗?
您确定 URL 正确吗?字体文件是否正确加载?
以下代码应该有效:
@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