Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
communitycreator

Language/country codes in HTML

Nouman Mehmood

Language codes in HTML

To define a language code in HTML, we should always include the lang attribute inside the <html> tag to define the language.

The given code defines the language in HTML. The code is followed by the ISO 639-1 language codes. We will go to the browser, select the code of any language, and put the code in it:

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

Country codes in HTML

In HTML, country codes can be used as an addition to the language code in the lang attribute.

The given code is used to define both the language and the country. The code is followed by the ISO 639-1 country codes. We will go to the browser, select the code of any country, and put it in:

<html lang="en-US">
...
</html>

In the lang attribute, the first two characters of the language code before - define the language code. The last two characters of the code after - define the country code.

RELATED TAGS

html
communitycreator
RELATED COURSES

View all Courses

Keep Exploring