English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
ang global attribute participates in the definition of the element language. This language is the language that cannot be edited by the element, or the language that should be written by the editable element. The tag contains a single entry, and the format of the value is defined by the tag used to define the language (BCP47) IETF document definition. If the content of the tag is an empty string, the language is set to unknown. If the tag content is invalid, according to BCP47, it is set to invalid.
This is a French paragraph demonstration:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML lang attribute usage (Basic Tutorial Website oldtoolbag.com)</title> </head> <body> <p>This is a paragraph.</p>/p> <p>Ceci est un paragraphe.</p>/p> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the lang attribute
The lang attribute specifies the language of the element content.
In HTML5you can use the lang attribute on any HTML element (it will validate on any HTML element. However, it may not be useful).
In HTML 4.01In HTML, the lang attribute cannot be used with <base>, <br>, <frame>, <frameset>, <hr>, <iframe>, <param>, and <script>.
<element lang="language_code">
Value | Description |
---|---|
language_code | Specifies the language code for the element content. Language Code Reference Manual. Language Code Reference Manual |