HTML lang Attribute

The HTML lang attribute define the language of the HTML element’s content. It is a global attribute that means it can be used on any HTML element.


Following is the syntax −

<tagname lang=”value”></tagname>

Here, value represent ISO language code.

Let us see an example of HTML lang Attribute −


Live Demo

<!DOCTYPE html>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
      text-align: center;
<h1>HTML lang Attribute Demo</h1>
<p lang="en">This is a paragraph element with some dummy text and lang attribute.</p>