---
title: "A: < html> must have a lang attribute (WCAG 3.1.1)"
description: "A: <html> must have a lang attribute (WCAG 3.1.1) SiteCockpit Monitoring"
---

[Skip to content](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang#main-content)

- [English](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang)
- [Deutsch](https://help.sitecockpit.com/de/dokumentation/easymonitoring-checks/automatische-pruefungen/html-has-lang)

English

Show submenu for translations

![SiteCockpit Logo](https://help.sitecockpit.com/hs-fs/hubfs/siteCockpit%20mit%20claim_rgb.png?width=328&height=92&name=siteCockpit%20mit%20claim_rgb.png)

- [Tickets](https://hub.sitecockpit.com/portal)
- [Dokumentation](https://help.sitecockpit.com/de/dokumentation)
- [Abmelden](https://146086235.hs-sites-eu1.com/_hcms/mem/logout)

Open main navigation

Close main navigation

- [Tickets](https://hub.sitecockpit.com/portal)
- [Dokumentation](https://help.sitecockpit.com/de/dokumentation)
- [Abmelden](https://146086235.hs-sites-eu1.com/_hcms/mem/logout)
- - [English](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang)
    - [Deutsch](https://help.sitecockpit.com/de/dokumentation/easymonitoring-checks/automatische-pruefungen/html-has-lang)
  
  
  
  
  
  
  English
  
  Show submenu for translations
- [Contact us](mailto:kontakt@sitecockpit.com)

[Contact us](mailto:kontakt@sitecockpit.com)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Documentation](https://help.sitecockpit.com/en/documentation?hsLang=en)
2. [Backend](https://help.sitecockpit.com/en/documentation/backend?hsLang=en)
3. [easyMonitorung automatic checks](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easymonitorung-automatic-checks)

# A: < html> must have a lang attribute (WCAG 3.1.1)

## html-has-lang

- [**Meaning**](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang#This-means)
- [**Impact**](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang#Impact)
- [**Recommendation**](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang#Recommendation)
- [**Examples**](https://help.sitecockpit.com/en/documentation/easymonitoring-checks/automated-checks/html-has-lang#Example)

Ensure that every HTML document has a **lang** attribute.

### **This means**

The root element <html> needs a **lang** attribute with a **valid BCP-47 language code** (e.g., `de`, `de-DE`, `en`). Without or with an incorrect value, screen readers, translations, and spell checking cannot reliably recognize the page language.

### **Impact**

Without the correct language setting, content is **pronounced incorrectly**, hyphenation and autocorrect do not work properly, and **users** lose orientation. Additionally, the risk of WCAG violations increases.

### **Recommendation**

- Set the **primary language** of the page on <html> (e.g., `lang="de"`).
- **Mark sections in other languages** additionally on the respective element (e.g., `lang="en"` for a quote).
- **Use valid BCP-47 tags** (hyphen, not underscore; no placeholders like `xx`).
- No conflicting information (no empty `lang=""`, no differing `xml:lang`).
- Update the attribute when **dynamically switching languages**.

### **Example**

*Problematic*

```
<!doctype html><html>  <head><title>Contact</title></head>  <body>Welcome</body></html> <!-- empty or invalid --><html lang=""></html><html lang="de_DE"></html><html lang="german"></html>
```

*Better*

```
<!doctype html><html lang="de">  <head><meta charset="utf-8"><title>Contact</title></head>  <body>    <p>Welcome to our site.</p>    <blockquote lang="en">Accessibility improves everyone’s experience.</blockquote>  </body></html>
```

**Related WCAG criterion:**  
[WCAG 3.1.1 - Language of Page](https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html)

- [General Information](https://help.sitecockpit.com/en/documentation/general-information?hsLang=en#main-content)
  
  
  
  
  
    - [Information](https://help.sitecockpit.com/en/documentation/general-information?hsLang=en#information)
    - [Dashboard](https://help.sitecockpit.com/en/documentation/general-information?hsLang=en#dashboard)
- [Backend](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#main-content)
  
  
  
  
  
    - [easyVision](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easyvision)
    - [easyMonitoring](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easymonitoring)
    - [easyMonitorung manual checks](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easymonitorung-manual-checks)
    - [easyMonitorung automatic checks](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easymonitorung-automatic-checks)
    - [easyAI](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easyai)
    - [easyStatement](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easystatement)
    - [Contrast Checker](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#contrast-checker)
    - [easyLanguage](https://help.sitecockpit.com/en/documentation/backend?hsLang=en#easylanguage)
- [easyVision integration](https://help.sitecockpit.com/en/documentation/easyvision-integration?hsLang=en#main-content)
  
  
  
  
  
    - [Setup](https://help.sitecockpit.com/en/documentation/easyvision-integration?hsLang=en#setup)
    - [Installlation](https://help.sitecockpit.com/en/documentation/easyvision-integration?hsLang=en#installlation)
    - [Browser Extensions](https://help.sitecockpit.com/en/documentation/easyvision-integration?hsLang=en#browser-extensions)
- [Servicepartner](https://help.sitecockpit.com/en/documentation/servicepartner?hsLang=en#main-content)
  
  
  
  
  
    - [General Information](https://help.sitecockpit.com/en/documentation/servicepartner?hsLang=en#general-information)
    - [Stripe](https://help.sitecockpit.com/en/documentation/servicepartner?hsLang=en#stripe)
- [Support](https://help.sitecockpit.com/en/documentation/support?hsLang=en#main-content)
  
  
  
  
  
    - [FAQ](https://help.sitecockpit.com/en/documentation/support?hsLang=en#faq)
    - [Ticket system](https://help.sitecockpit.com/en/documentation/support?hsLang=en#ticket-system)

[![siteCockpit rgb](https://help.sitecockpit.com/hs-fs/hubfs/siteCockpit%20rgb.png?width=200&height=42&name=siteCockpit%20rgb.png "siteCockpit rgb")](https://www.sitecockpit.com/)

Telefon: +49(0)30 403 64 98 98  
E-Mail: kontakt@sitecockpit.com

<https://www.facebook.com/sitecockpit/> <https://de.linkedin.com/company/sitecockpit> <https://www.instagram.com/sitecockpit/> <https://www.youtube.com/@SiteCockpit> [mailto:kontakt@sitecockpit.com](mailto:kontakt@sitecockpit.com)

Copyright © 2025, Site Cockpit GmbH