<html>: The HTML Document / Root element
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.
Attributes
This element includes the global attributes.
-
manifest
Deprecated Non-standard
-
Specifies the URI of a resource manifest indicating resources that should be cached locally.
-
version
Deprecated
-
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 lang="en">
<head>…</head>
<body>…</body>
</html>
Accessibility concerns
While HTML does not require authors to specify <html>
element start and ending tags, it is important for authors to do so as it will allow them to specify the lang
for the webpage. Providing a lang
attribute with a valid language tag according to RFC 5646: Tags for Identifying Languages (also known as BCP 47) 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.
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
html |
Yes |
12 |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
manifest |
4 |
12 |
3.5-84
3
Before version 3.5, Firefox ignores the NETWORK and FALLBACK sections of the cache manifest file.
|
10 |
10.6 |
4 |
4 |
18 |
4-84 |
11 |
3.2 |
1.0 |
version |
Yes |
12 |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
xmlns |
Yes |
12 |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
See also
- MathML top-level element:
<math>
- SVG top-level element:
<svg>