HTML | <html> Tag

The <html> tag in HTML is used to define the root of HTML and XHTML documents. The <html> tag tells the browser that it is an HTML document. It is the second outer container for everything that appears in an HTML document followed by the <!DOCTYPE> tag. The <html> tag requires a starting and end tag.

Syntax:

<html> HTML Contents... </html>

Attribute Value: The <html> tag contains single attribute xmlns whose attribute value is http://www.w3.org/1999/xhtml. It is used to define the namespace attributes.



Below examples illustrate the <html> element in HTML:

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>html tag</title>
        <style>
            h1 {
                color: green;
            }
            body {
                text-align:center;
            }
        </style
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><html> Tag</h2>
    </body>
</html>                                                

chevron_right


Output:

Example 2: Using the xmlns attribute inside the <html> tag.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <head>
        <title>html Tag</title>
        <style>
            h1 {
                color:green;
            }
            body {
                text-align:center;
            }
        </style
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><html> Tag</h2>
    </body>
</html>                    

chevron_right


Output:

Supported Browsers: The browser supported by <html> tag are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up

I am a technology enthusiast who has a keen interest in programming I am pursuing Engineering in Computer Science from GEU, Dehradun I like to unwind by watching movies and English sitcomsI have a keen interest in music

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.