W3cubDocs

/HTML

<html>

The HTML <html> element represents the root (top-level element) of an HTML document, so it is also referred to as the root element. All other elements must be descendants of this element.

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

Attributes

This element includes the global attributes.

manifest deleted
Specifies the URI of a resource manifest indicating resources that should be cached locally. See Using the application cache for details.
version deleted
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.
xmlns
Specifies the XML Namespace of the document. Default value is "http://www.w3.org/1999/xhtml". This is required in documents parsed with XML parsers, and optional in text/html documents.

Example

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

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of '<html>' in that specification.
Living Standard
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

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 (Yes) (Yes) (Yes) (Yes) (Yes)
manifest (Yes) ? 3.0 (1.9) (Yes) (Yes) (Yes)
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) (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>

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html