<html> element must have a valid value for the lang attribute

How to fix the html-lang-valid accessibility rule. Language.

What this rule checks

Ensure the lang attribute of the <html> element has a valid value

Who is affected

The page language code isn't a real language code, so screen readers can't use it.

How to fix it

Use a valid BCP 47 code such as "en", "en-GB", "de" or "hu".

Example

Before

<html lang="english">

After

<html lang="en">

WCAG success criteria

When this rule fails, the page fails:

Find it on your own page

Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.

More detail