Skip to content
Related Articles

Related Articles

HTML <html> Tag

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 22 Jul, 2022
Improve Article
Save Article

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: 
 

HTML




<!DOCTYPE html>
<!-- html tag starts here -->
<html>
 
        <body>
             
            <h1>GeeksforGeeks</h1>
            <h2><html> Tag</h2>
             
        </body>
 
</html>                   
<!-- html tag ends here -->

Output: 
 

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

HTML




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

Output: 
 

Supported Browsers: 

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!