我已经开发了一个支持英语和日语的网络应用程序。在英文中,我有不同的字体。最近,我接到了一项要求,即对于某些元素(如h1、h2、p),需要为日语使用不同的字体。
许多元素已经写好了字体名称,所以我不能逐个更改。请建议我如何处理这种情况。
我可以将class添加到body中,例如“lang-eng”或“lang-ja”,根据不同的语言进行区分。
@font-face {
font-family: "DroidSerif";
src: url("https://rawgit.com/google/fonts/master/ufl/ubuntumono/UbuntuMono-Italic.ttf")
format("truetype");
}
Japanese :
@font-face {
font-family: "DroidSerif";
src: url("https://fonts.gstatic.com/ea/notosansjp/v5/NotoSansJP-
Regular.woff2")
format("truetype");
是否可以使用相同的字体名称但不同的src?谢谢。
lang
属性的作用。 - CBroe