The “lang” attribute specifies the language of the web page content. Here’s how you can set it up in your HTML document:
To set the language for the entire HTML document, you should put the “lang” attribute inside the tag with your desired language code as its value. For instance, if you need to set the web page’s language to English, you would do:
```
…
```
This is stating that the text inside the HTML document is in English.
“en” is an example of a language code, which is defined in the ISO 639-1 standard. Some other codes are “fr” for French, “es” for Spanish, “de” for German, etc.
You can also set the language for a part of the HTML document by putting the “lang” attribute in any HTML tag:
```
Hola, ¿cómo estás?
This is signifying that the text inside the paragraph is in Spanish. The browser can use this information to select the right fonts and keyboard for this content, and search engines can use it to index the content correctly.