Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

What is the difference between <html lang=”en’> and <html lang=”en-US’> ?

  • Last Updated : 08 May, 2020

The lang attribute specifies which language is used to write the content of a web page. It is used to set the language for the whole text of the web page.

The difference between <html lang=”en’> and <html lang=”en-US’> is described below:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<html lang=”en’>
The <html lang=”en’> only specifies the language code of the page meaning en or English is used for all the text on the page.

Example:






<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,
      initial-scale=1.0">
    <title>lang Attribute</title>
    <style>
        body{
            text-align: center;
        }
        h1{
            color: green;
        }
    </style>
</head>
<body>
    <h1>GeeksforGeeks</h1>
    <p>jQuery is an open source JavaScript library that 
simplifies the interactions between an HTML/CSS document,
or more precisely the Document Object Model (DOM), and JavaScript.
Elaborating the terms, jQuery simplifies HTML document 
traversing and manipulation, browser event handling, 
DOM animations, Ajax interactions, and cross-browser 
JavaScript development.</p>
</body>
</html>

Output:

<html lang=”en-US’>
The <html lang=”en-US’> specifies the language code of the page followed by the country code that means US style of English language is used for all the text on the page.

<html lang=”en-GB’> which means the United Kingdom style of English
<html lang=”en-IN’> which means the Indian style of English

Example:




<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,
     initial-scale=1.0">
    <title>lang Attribute</title>
    <style>
        body{
            text-align: center;
        }
        h1{
            color: green;
        }
    </style>
</head>
<body>
    <h1>GeeksforGeeks</h1>
    <p>jQuery is an open source JavaScript library that
 simplifies the interactions between an HTML/CSS document,
 or more precisely the Document Object Model (DOM), and JavaScript.
Elaborating the terms, jQuery simplifies HTML document 
traversing and manipulation, browser event handling, 
DOM animations, Ajax interactions, and cross-browser
 JavaScript development.</p>
</body>
</html>

Output:




My Personal Notes arrow_drop_up
Recommended Articles
Page :