Is there a way to stylize text on an HTML page such that it automatically uses a different font for different languages? My website uses both English and Arabic. I\'d like t
Jukka is right, you cannot distinguish between languages automatically. You might need to set lang attribute where appropriate. You have these options:
The code snippet for the first solution goes like this:
body {
font-family:Palatino,serif;
}
:lang(ar) {
font-family: "Traditional Arabic",serif;
}
For the second option, I already said it is not such a great idea. This is not, because many languages are written either Left-To-Right or Right-To-Left. You surely don't want to use "Traditional Arabic" font for Hebrew text. I mentioned this option, because it can help you solve other problems.
For the last one:
:script(Arab) {
font-family: "Traditional Arabic",serif;
}