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.
Syntax
Following is the syntax −
<tagname lang=”value”></tagname>
Here, value represent ISO language code.
Let us see an example of HTML lang Attribute −
Example
<!DOCTYPE html> <html> <style> body { color: #000; height: 100vh; background-color: #8BC6EC; background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%); text-align: center; } </style> <body> <h1>HTML lang Attribute Demo</h1> <p lang="en">This is a paragraph element with some dummy text and lang attribute.</p> </body> </html>