freeCodeCamp/guide/english/html/attributes/lang/index.md

586 B

title
Lang

Lang

In HTML, Lang tag is used to declare the language of the whole or a part of a web page.

Examples

<html lang="en">
</html>

The lang attribute can also be used to specify the language of a specific element:

<p lang="hi">
  फ्री कोड कैंप
</p>

In the above example, "hi" denotes the Hindi language. Similarly, you can use "en" for English, "es" for Spanish, "fr" for French and so on.

Refer to ISO 639-1 for the appropriate two-digit Language code.