Define the language of the page
Last updated:
How to define the language of the page?
Add a lang attribute to the html element with a valid language code.
For English this would be:
<html lang="en">
<!-- content -->
</html>
Valid language codes are either two-letter or three-letter language codes. You can find the list of valid language codes in the ISO 639-1 code list.
Why is this important?
The use cases for the <html lang> attribute are:
- Screen readers
- Translation such as Google Translate
- Spellchecking
- Localized date and time input
It is crucial to define a valid lang attribute on the html tag. A screen reader uses the lang attribute to select the corresponding language to speak the text if that language is available.
More info:
Rule info
Standard
User impact
Serious impact Significantly hinders users with disabilities. Should be fixed as a high priority. Critical : blocks access entirely Serious : significantly hinders use Moderate : causes difficulty Minor : minimal disruptionFix complexity
Medium level of technical expertise required To resolve this issue, you might need some technical background. It is possible to fix this issue without needing a software developer. This depends on the Content Management System (CMS) that your website is built with.Affects
Free Website Accessibility Audit