Missing Language Attribute
The lang attribute on the <html> element declares the primary language of the page content. Screen readers use this to switch to the correct pronunciation engine. Without it, a screen reader might try to read French content with English pronunciation rules, making it incomprehensible.
Why It Matters
Missing lang is a WCAG 2.1 Level A violation. Screen readers default to the user's system language, which may not match the page content. Search engines use the lang attribute to serve the correct language version in search results. It's one of the easiest accessibility fixes and has direct SEO benefits.
Code Examples
<!-- No lang attribute --> <html> <head>...</head> <!-- Wrong: lang on body instead of html --> <html> <body lang="en">
<!-- Correct: lang on html element --> <html lang="en"> <!-- For French content --> <html lang="fr"> <!-- For specific regional variant --> <html lang="en-US">
How to Fix
- 1Add lang="en" (or your language code) to the opening <html> tag.
- 2Use the correct ISO 639-1 language code: en, fr, de, es, ja, zh, etc.
- 3For mixed-language content, set the main language on <html> and use lang attributes on specific elements for other languages.
- 4If your site serves multiple languages, use different lang values on each language version.
Check Your Accessibility Now
Our accessibility checker detects this issue automatically.
Open Accessibility CheckerHostinger — Fast & Affordable Web Hosting
Deploy accessible, validated code on reliable hosting.
Related Accessibility Errors
Missing Alt Text on Images
Learn why alt text is required on images, how it affects accessibility and SEO, and how to write effective alt attributes.
Skipped Heading Levels
Jumping from H1 to H3 breaks the document hierarchy. Learn how to structure headings correctly for screen readers and SEO.
Missing Form Labels
Form inputs without labels are inaccessible to screen readers. Learn how to properly label form fields for WCAG compliance.