Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

HTML lang Attribute


Example

Some French text in a paragraph:

<p lang="fr">Ceci est un paragraphe.</p>
Try it Yourself »

Definition and Usage

The lang attribute specifies the language of the element's content.

Common examples are "en" for English, "es" for Spanish, "fr" for French, and so on.


Browser Support

Attribute
lang  Yes Yes Yes Yes Yes

Syntax

<element lang="language_code">

Attribute Values

Value Description
language_code Specifies the language code for the element's content. Language code reference

Related Pages

HTML Tutorial: HTML Attributes

HTML DOM Reference: HTML DOM lang Property