Lang Attribute Validity

The lang attribute must be correctly formatted and use a valid, recognized language tag on any HTML element.


Article with whitespace lang:

This <article> element uses lang="  ", which contains only whitespace characters. Because it lacks a valid language subtag, the lang value is invalid and fails WCAG 3.1.2.


They wandered into a strange Tiki bar on the edge of the small beach town.

Note: Possible to automatically test. Automated tools can detect when a lang attribute is empty or consists only of whitespace.

axe detected: 3.1.2  |  QualWeb detected: 3.1.2