嗨,我刚刚开始在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,它没有实现...
谁能解释一下这件事?
发布于 2015-04-23 10:33:10
您确定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
https://stackoverflow.com/questions/29804317
复制相似问题