9) lang Attribute:
The lang attribute of the <html> tag declares the language of the HTML document.
The lang attribute has been replaced by the XML: lang attribute in new XHTML documents.
The lang attribute is used for earlier version compatibility.
Syntax:
<html lang = "en">
Code:
<!DOCTYPE html>
<html lang = "en">
<head>
<title>lang Attribute</title>
</head>
<body>
<h1>lang Attribute</h1>
<p>The <strong>lang </strong>attribute of the <html> tag declares the language of the HTML document.</p>
<p>The <strong>lang </strong>attribute has been replaced by the <strong>XML: lang</strong> attribute in new <strong>XHTML </strong>documents.</p>
<p>The <strong>lang </strong>attribute is used for earlier version compatibility.</p>
</body>
</html>
Output:
You may be interested in the following topics:
- HTML Favicon
- HTML Links
- HTML Colors
- HTML Quotations
- HTML Comments
- HTML Formatting
- HTML Styles
- HTML Paragraph
- HTML Headings
- HTML Attributes
- HTML Elements
- What is HTML?