html-has-lang

<html> element must have a lang attribute.

Who might be affected
Screen Reader
Cognitive

Description

The interface language statement (lang attribute) allows user agents, in general, and assistive technologies, in particular, to parse and read the content more accurately. If a lang attribute is not specified or has an invalid value, the page language will fall back to the user agent or assistive technology's configured default language.

Quick Fixes

Add a "lang" attribute to the "html" tag.
1
2<!DOCTYPE html>
3<html lang="en">
4 <!-- html content -->
5</html>
6
If an element in the body of the page uses a different language than the one defined on the "html" tag, you can override the language definition by using the language feature on specific elements as well.
1
2<!DOCTYPE html>
3<html lang="en">
4
5
6 <!-- html content -->
7
8 <p lang="fr">Bon Appétit</p>
9</html>
10

How Users Are Affected

Assistive technologies may misread or mispronounce the content and therefore mislead the user or even prevent him from understanding and using the interface properly.

WCAG Success criteria

This issue might cause elements to fail one or more of the following Success criteria:
3.1.1 Language of Page (A)