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 |
Permitted parents | None. This is the root element of a document. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | No role permitted
|
DOM interface | HTMLHtmlElement
|
Attributes
This element includes the global attributes.
manifest
'- Specifies the URI of a resource manifest indicating resources that should be cached locally. See Using the application cache for details.
version
'- 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%22
. This is required in documents parsed with XML parsers, and optional in text/html documents.
Example
<!DOCTYPE html>
<html lang="en">
<head>...</head>
<body>...</body>
</html>
Accessibility concerns
Providing a lang
attribute with a valid IETF identifying language tag on the <html>
element will help screen reading technology determine the proper language to announce. The identifying language tag should describe the language used by the majority of the content of the page. Without it, screen readers will typically default to the operating system's set language, which may cause mispronunciations.
Including a valid lang
declaration on the <html>
element also ensures that important metadata contained in the page's <head>
, such as the page's <title>
, are also announced properly.
- MDN Understanding WCAG, Guideline 3.1 explanations
- Understanding Success Criterion 3.1.1 | W3C Understanding WCAG 2.0
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of '<html>' in that specification. | Living Standard | |
HTML5The definition of '<html>' in that specification. | Recommendation | Added support for the manifest attribute (deprecated later).
Obsoleted the |
HTML 4.01 SpecificationThe definition of '<html>' in that specification. | Recommendation | Deprecated the version attribute
|
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
html
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support Yes |
IE
Full support Yes |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Chrome
Full support 4 |
Edge
Full support 12 |
Firefox Full support 3.5 Full support 3.5 Partial support 3 Notes' Versions of Firefox prior to 3.5 ignore the |
IE
Full support 10 |
Opera
Full support 10.6 |
Safari
Full support 4 |
WebView Android
Full support 4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 4 |
Opera Android
Full support 11 |
Safari iOS
Full support 3.2 |
Samsung Internet Android
Full support 1.0 | |
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support Yes |
IE
Full support Yes |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
xmlns
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support Yes |
IE
Full support Yes |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- Deprecated. Not for use in new websites.'
- Deprecated. Not for use in new websites.
- See implementation notes.'
- See implementation notes.
See also
- MathML top-level element:
<math>
- SVG top-level element:
<svg>
<html>: The HTML Document / Root element by Mozilla Contributors is licensed under CC-BY-SA 2.5.