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.
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;
}
Can this be done?
Thanks!
Change the style sheet on language select
You could use the CSS
:lang
pseudo class if you set thelang
attribute in your HTML to alter the style. For example see demo or the following code:CSS
HTML
This might be helpful: http://billposer.org/Linguistics/Computation/UnicodeRanges.html
You're looking for Hangul which is "The Korean alphabet, also known as Hangul,[nb 1] or Chosongul"
Regards
If you're using some dynamic language as server side of your website, you can simply do a dynamic CSS loading based on the Locale.
E.g. you have, in css folder, the following:
So you can have a separation of global settings from locale-specific ones and can load the required style dynamically with ease.
If you have a static HTML page instead, you can have JavaScript to load the CSS dynamically or you can use the
pseudo-class as pointed by others as well.
Whatever solution you choose, remember to keep an eye on browser-compatibility.
NOTE: Often it is a better solution to have the user explicitly select his/her preferred locale instead of automatically setting one based on the client's system information.
you could use something similar to:
or if you would like to only specify
lang=""
once, instead of on every element, you could doIn your case the
lang
attribute is set on thehtml
tag, so you could style all the elements you need based on that using the rules: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"]
.