View video tutorial

HTML <html> Tag

HTML

The <html> tag represents the root element of an HTML document.

HTML <html> Tag.


➔ The <html> element represents the top-level element of an HTML document.

➔ It is the root element and other elements must be descendants of this element.

Element Attributes

Attribute Value Description
xmlns http://www.w3.org/1999/xhtml This specifies the namespace to use for XHTML documents.

Supported Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<!DOCTYPE html>
<html>
<head>
    <title>HTML html tag Example</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8" />
    <style>
        div {
            background-color: #e2e2e2;
            padding:10px 10px;
            margin:20px 10px;
        }
    </style>
</head>
<body>
    <div>
        <h3>HTML html tag Example</h3>
        <p>This is the root element of an HTML document</p>
        <p>It is the top-level element and other elements must be descendants of this element.</p>
    </div>
</body>
</html>
Try it Now »

Click on the "Try it Now" button to see how it works.