The value of the lang attribute used to indicate the primary language of the page is for the wrong language.
- Rule ID:
- User Impact:
The primary language of the page MUST be identified accurately on the <html> element.
Most screen readers can read several different languages. Screen reader users select a default language when installing and configuring their screen reader. If no language is specified in the HTML document, the screen reader will read the document in the user's default language. If the screen reader's default language does not match the page language, the page will be read with a pronunciation that does not match the language, often making it impossible to understand.
People that speak more than one language though will likely access websites in more than one language, so specifying the page language correctly becomes important. To fix this issue, correctly identify the primary language for the page in the <html> element.
Specifying English as the primary language of the document.
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>I Have a Dream, Excerpt</title> </head> <body> </body> </html>
Empty lang attribute
<!doctype html> <html lang=""> <head> <meta charset="UTF-8"> <title>I Have a Dream, Excerpt</title> </head> <body> </body> </html>
Fix this issue by:
- Provide the correct lang attribute value.
Don't do this:
- Provide an incorrect lang attribute value.
- Fail to provide a lang attribute value.