HTML - <html>

The HTML <html> element (or HTML root element) represents the root of an HTML document. All other elements must be descendants of this element.

Example

 

The DOCTYPE used in the following example indicates HTML5.

HTML
<!DOCTYPE html>
<html>
  <head>...</head>
  <body>...</body>
</html>

Description  

The HTML <html> element (or HTML root element) represents the root of an HTML document. All other elements must be descendants of this element.

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.

Content categories None.
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 As the root element of a document, or wherever a subdocument fragment is allowed in a compound document.
DOM interface HTMLHtmlElement

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 (Yes) (Yes) (Yes) (Yes)
manifest (Yes) 3.0 (1.9) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
manifest (Yes) 1.0 (1.9) (Yes) (Yes) (Yes)

See Also  

  • MathML top-level element: <math>
  • SVG top-level element: <svg>

Specifications  

Specification Status Comment
WHATWG HTML Living Standard
The definition of '<html>' in that specification.
Living Standard No change since last snapshot.
HTML5
The definition of '<html>' in that specification.
Recommendation Added support for the manifest attribute (deprecated later).
Obsoleted the version attribute
HTML 4.01 Specification
The definition of '<html>' in that specification.
Recommendation Deprectated the version attribute

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/html

Element HTML HTML Root Element Reference Web