Skip to main content
Version: v6

HTML tag is missing a lang attribute

HTML tag is missing a lang attribute — rule summary
FieldValue
Rule codeHtml_Attribute_Lang_Missing
WCAG conformance levelA
WCAG success criterion3.1.1 Language of Page
Must be fixed at sourceNo

Description

Each page should indicate which primary language it is intended for. This is achieved by adding an appropriate ISO lang language attribute to the HTML tag. We detected an HTML tag missing a lang attribute. Add an ISO language code to the HTML tag to standardize the language used on the page. View a full list of ISO language codes here: https://www.w3docs.com/learn-html/html-language-codes.html

How to fix

Add a lang attribute to the page's <html> element. The value is a standardized language code, with an optional region code. For example, use lang="en" for English:

<html lang="en">
...
</html>

For Spanish as spoken in Spain, use lang="es-ES":

<html lang="es-ES">
...
</html>

For a list of language and region codes, refer to the W3C's Declaring language in HTML.