A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-html-tag/ below:

HTML <html> Tag - GeeksforGeeks

HTML <html> Tag

Last Updated : 11 Jul, 2025

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.

Syntax:

<html> HTML Contents... </html>
HTML Document Structure HTML Structure Default CSS Settings

The following default values are mostly displayed by the current browsers:

html {
  display: block;
  visibility: visible
}

Attribute Value:

The <html> tag includes the xmlns attribute. This attribute defines the namespace for attributes, ensuring proper interpretation and compatibility of XHTML elements.

Note: The <html> tag supports the Global Attributes in HTML.

HTML Tag Examples

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

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

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="https://www.w3.org/1999/xhtml/">

<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>
Browsers Support

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4