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

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:

<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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.