开发者

Is there a way of only modifying Chinese characters through CSS (without affecting Roman characters)?

开发者 https://www.devze.com 2023-01-09 21:14 出处:网络
I noticed that Chinese characters tend to be a bit smaller in my website than Roman characters.开发者_JAVA技巧

I noticed that Chinese characters tend to be a bit smaller in my website than Roman characters.

开发者_JAVA技巧

I would like to know if there's a way of modifying them through CSS without touching Roman characters.

For instance, assigning font-size to only Chinese characters.


You have basically two options:

  • Enforce server-side that all Chinese text, and only Chinese text, is wrapped in HTML elements labeled lang="zh". Then you can select them with :lang(zh) and apply a larger font-size.
  • Use @font-face to load a Chinese font whose metrics more closely match the Roman font you are using.
0

精彩评论

暂无评论...
验证码 换一张
取 消