【发布时间】:2017-03-22 15:44:36
【问题描述】:
我希望我的文本在web view 中看起来更好,但是当我尝试为其加载字体时,它不会改变。 根据一些问题this 和this 我找到了这段代码:
<style type="text/css">
@font-face {
font-family: "My Custom Font";
src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
}
p.customfont {
font-family: "My Custom Font", Verdana, Tahoma;
}
</style>
<p class="customfont">Hello world!</p>
我试过这个从资产加载它:
<style type=text/css>
@font-face {
font-family: "ROYA";
src="Roya.ttf";
}
p.customfont {
font-family: "ROYA", Verdana, Tahoma;
}
<p class="ROYA">Hello world!</p>
但它不起作用。我该怎么办?
【问题讨论】:
标签: html css fonts font-face custom-font