gpt4 book ai didi

css - 字体未在 Monaca onsen ui 中加载

转载 作者:太空宇宙 更新时间:2023-11-04 03:09:39 25 4
gpt4 key购买 nike

您好,我刚刚开始在 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,它没有实现...

有人可以阐明这一点吗?

最佳答案

您确定网址正确吗?字体文件加载正确吗?

下面的代码应该可以工作:

@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

关于css - 字体未在 Monaca onsen ui 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29804317/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com