<?xml version="1.0" encoding="utf-8"?>

The lang attribute

The lang attribute

While not using it won't break your page, the lang attribute inside the <html> tag lets search engines and browsers know your page's language to return language-specific results.

Here, you can also specify the country of the language if the language in question has more than one variation. For American English, the attribute will look like this — lang="en-US", where the first two letters stand for the language and the two letters after the hyphen for the country.

You can find the complete list of languages and countries codes on W3Schools website.[1]

Improve your UX & Product skills with interactive courses that actually work