<html> element must have a lang attribute

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

What this rule checks

Ensure every HTML document has a lang attribute

Who is affected

Without a page language, screen readers guess which voice and pronunciation to use, and often read the page in the wrong accent or language.

How to fix it

Add a lang attribute to the <html> element.

Example

Before

<html>

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