Articles → HTML → lang attribute in HTML

lang attribute in HTML






Why do we need lang attribute?







Syntax


<element lang="language_code">



What is language code?









Example


<html lang="en">
<head>
    <title>lang demo</title>
</head>
<body>
</body>
</html>



Using dialect in lang








<html lang="en-us">
<head>
    <title>lang demo</title>
</head>
<body>
</body>
</html>



Browser support


Internet ExplorerFirefoxChromeSafariOperaEdge
YesYesYesYesYesYes



Posted By  -  Karan Gupta
 
Posted On  -  Friday, September 23, 2016
 
Updated On  -  Saturday, September 16, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250