根据语言更改字体大小 [英] Change Font Size Based on Language

查看:148
本文介绍了根据语言更改字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我已经阅读了一些建议与CSS语言标签,但似乎一切都需要将标签中的语言放在高级。我不能改变围绕韩语语言的html标签,它有与英语相同的h1标签。这是因为它是同一网站的翻译版本。

So i have read a few suggestions with the css language tag, but it seems like everything requires placing the language in the tag in advanced. I am not able to change the html tags around the korean language, it has the same h1 tag as the english. It is because it is a translated version of the same website.

我想为韩语版本使用与英语不同的字体和字体大小。我可以通过只知道语言这样做吗?我发现一些其他问题处理unicode范围使用@ font-face {},一个,我无法弄清楚什么unicode范围韩语,我试图查看所有的文档,但我只是不理解如何unicode范围计算并写。此外,我希望有一个选项,如

I want to have a different font and font size for the korean version than the english. Can i do this by just knowing the language? I found some other questions dealing with the unicode range that used @font-face { } , for one, I cant figure out what unicode range Korean is, i have tried looking at all the documentation but i just dont comprehend how unicode ranges are calculated and written. Also, i was hoping there was an option like,

h1{
unicode-range: korean;
font-size: 10px;
}

h1{
unicode-range: english;
font-size 20px;
}

可以这样做吗?

谢谢!

推荐答案

c> lang 属性设置在 html 标签上,因此您可以使用以下规则为所需的所有元素设置样式:

In your case the lang attribute is set on the html tag, so you could style all the elements you need based on that using the rules:

html:lang(en) h1{
    font-size: 20px;
}

html:lang(ko) h1{
    font-size: 10px;
}

但请注意,:lang 伪类仅在IE8 +中受支持。如果你需要在IE7 +的支持,你最好的打算是这种类型的语法: a [lang =en]

Be careful, though, the the :lang pseudo-class is supported only in IE8+. Should you need support in IE7+, your best bet is going for the syntax of this type: a[lang="en"].

这篇关于根据语言更改字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆