Erica Xu
Erica Xu

Reputation: 555

Use CSS to target a language

I want to set only the Chinese characters to be larger in a web page and make the English letters stay the same, because somehow the Chinese characters appear much larger than the English characters.

Is this possible? Thanks.

Upvotes: 3

Views: 1037

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201798

It is not possible without wrapping the Chinese characters into elements, like <span lang=zh>...</span> (for which you could then use :lang(zh) { ... }).

On the other hand, if Chinese and English characters look too different in size, it is probably caused by the use of stylistically incompatible fonts. If you set e.g. just font-family: Arial, then English characters will appear in Arial and Chinese character in some other font, depending on browser defaults, because Arial does not contain Chinese characters. Then the solution would be to use a font-family value that contains only such fonts that have Chinese characters (in acceptable style).

Upvotes: 5

Related Questions