HTML lang Global Attribute

Description

The global attribute lang defines the language of the content of the element. The first two letters indicate the language code, if there is a dialect, then two more letters are used, indicated by a hyphen (for example, USA: lang="en-us").

Syntax

<element lang="language_code">

Values

  • language_codeSpecifies the language code for the content of the element.

Example

<p>This paragraph is English, but the language is not specifically defined.</p>
<p lang="en-GB">This paragraph is defined as British English.</p>
<p lang="fr">Ce paragraphe est défini en français.</p>

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYesYesYesYesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYesYesYesYesYes