the Hutt
the Hutt

Reputation: 18418

why it shows different font for different language?

I have following code snippet.
It displays different fonts for different language. The combinations vary on different browsers and on different OS. e.g. on some browser it shows same font for all <code> elements/tags.
I have not changed any browser settings.

<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title> different font </title>
  <code lang="en">int i = 0;</code><br>
  <code lang="ru">int i = 0;</code><br>
  <code lang="ja">int i = 0;</code><br>

  <div lang="en">font family</div>
  <div lang="ru">font family</div>
  <div lang="ja">font family</div>
</html>

Following is the screenshot on my system. Output may differ on your system.

The screenshot

Why is this happening?

Upvotes: 1

Views: 635

Answers (1)

Peter Constable
Peter Constable

Reputation: 3650

Evidently the browsers you have tried have different default font settings for different languages. If you specify Russian as the language, the browser may be expecting Cyrillic script characters rather than Latin script, and select a different default font for that reason. If you specify Japanese as the language, then it expects kana or kanji characters and will almost certainly select a different default font.

Upvotes: 1

Related Questions