HTML Attributes

Please Share On:

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 &lt;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:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial