HTML html Tag Examples

Example 1:  This example illustrates the <html> element in HTML.

HTML
<!DOCTYPE html>
<!-- html tag starts here -->
<html>

<body>
    <h1>w3wiki</h1>
    <h2>
        <html> Tag
    </h2>
</body>

</html>
<!-- html tag ends here -->

Output:

Example 2: In this example, we will be using the xmlns attribute inside the <html> tag. 

HTML
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>html Tag</title>
    <style>
        h1 {
            color: green;
        }

        body {
            text-align: center;
        }
    </style>
</head>

<body>
    <h1>w3wiki</h1>
    <h2>
        <html> Tag
    </h2>
</body>

</html>

Output:

HTML Tag

HTML is a language full of diverse elements, and one such element is the <html> tag. This tag, standing for ‘HyperText Markup Language’, is used to define the root of an HTML or XHTML document. It serves as the main container for all other HTML elements, excluding the <!DOCTYPE> declaration.

Similar Reads

Understanding the  Tag

The  tag acts as the main container for all HTML elements, framing the entire web content structure. It follows the  declaration and requires both opening and closing tags....

HTML html Tag Examples

Example 1:  This example illustrates the element in HTML....

Supported Browsers

Google Chrome 1 and aboveEdge 12 and aboveFirefox 1 and aboveSafariOpera...