Summary
The HTML root element (<html>) represents the root of an HTML or XHTML document. All other elements must be descendants of this element.
Usage context
| Permitted content | One <head> element, followed by one <body> element. |
| Tag omission | The start tag may be omitted if the first thing inside the <html> element is not a comment.The end tag may be omitted if the <html> element is not immediately followed by a comment, and it contains a <body> element either that is not empty, or whose start tag is present. |
| Permitted parent elements | None. |
| Normative document | HTML 5, section 4.1.1; HTML 4.01, section 7.3 |
Attributes
Like all HTML elements, this element supports the global attributes.
manifestHTML5 Requires Gecko 1.9- Specifies the URI of a resource manifest indicating resources that should be cached locally. See Offline resources in Firefox for details.
-
versionDeprecated since HTML4.01 Obsolete since HTML5 - Specifies the version of the HTML Document Type Definition that governs the current document. This attribute is not needed, because it is redundant with the version information in the document type declaration.
Example
The DOCTYPE used in the following example indicates HTML5.
<!DOCTYPE html> <html> <head>...</head> <body>...</body> </html>
Notes
Since the <html> element is the first in a document other than comments, it is called the root element. Although this tag can be implied, or not required, with HTML, it is required to be opened and closed in XHTML.
DOM interface
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | (Yes) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |


Mozilla Developer Network