Language · WCAG 2.0 Level A
<html> element must have a lang attribute
Ensure every HTML document has a lang attribute.
What it means
The html-has-lang rule flags elements that fail this check. It maps to WCAG success criterion 3.1.1.
Who it affects
Screen reader users, whose software needs the language to pronounce text correctly, plus translation tools.
How to fix it
Add a lang attribute to the html element.
<html lang="en">
Check it on your site
Run a free scan. If this rule fails, the results list the affected elements. Deque, which maintains axe-core, also documents this rule in detail: Deque University: html-has-lang.
Quick answers
What does the axe rule "html-has-lang" check?
Ensure every HTML document has a lang attribute.
How do I fix "<html> element must have a lang attribute"?
Add a lang attribute to the html element.
Who is affected by html-has-lang failures?
Screen reader users, whose software needs the language to pronounce text correctly, plus translation tools.
Automated accessibility scan. Results are informational and may not identify every accessibility issue. This service is not legal advice, a compliance certification, or a substitute for comprehensive manual accessibility testing.