This check primarily benefits:
This section provides pass and fail examples for this check.
<html lang="fr">
<head>
<title>Exemple de page</title>
</head>
<body>
<p>Bonjour le monde !</p>
</body>
</html>The lang="fr" attribute correctly identifies the page as French.
<p>This is an English paragraph.</p>
<p lang="es">Este es un párrafo en español.</p>The lang="es" attribute correctly marks the Spanish text.
lang attribute<html lang="en">
<head>
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html><head>
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html><html> element<html>
<head>
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>Without a lang attribute, screen readers may use the wrong pronunciation rules.
<html lang="">
<head>
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>An empty lang attribute is invalid and does not provide useful information.
<html lang="english">Ensure that there is a valid language code, for example, english is not a valid language code. The correct code is en.
This section provides information about how to review and fix a lang attribute.
<html> element.<html> tag and confirm that there is a lang attribute with a valid value.Add a valid lang attribute.
If the attribute is missing, add the correct language code to the <html> tag:
<html lang="en">Fix any empty or incorrect lang attribute values.
Ensure that the lang attribute contains a valid BCP 47 language code, such as:
en (English)
fr (French)
de (German)
es (Spanish)
zh-CN (Simplified Chinese)
If the page contains multiple languages, apply langattributes where needed:
<p lang="it">Questo è un testo in italiano.</p>For the official list of language tags, visit: IANA language subtag registry.
For more information about BCP 47 language codes, visit Language tags in HTML and XML.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.