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.

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>
</head>
<body>
  <h2>HTML html tag Example</h2>
  <h1>This is the root element of an HTML document</h1>
  <p>It is the top-level element and other elements must be descendants of this element.</p>
</body>
</html>
Try it Now »

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