Articles → HTML → Lang Attribute In HTML
Lang Attribute In HTML
Why Do We Need A Lang Attribute?
Syntax
<element lang="language_code">
What Is Language Code?
- en stands for English
- hi stands for Hindi
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 Explorer | Firefox | Chrome | Safari | Opera | Edge |
---|
Yes | Yes | Yes | Yes | Yes | Yes |