summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Fhtml.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/html/element%2Fhtml.html')
-rw-r--r--devdocs/html/element%2Fhtml.html131
1 files changed, 131 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fhtml.html b/devdocs/html/element%2Fhtml.html
new file mode 100644
index 00000000..477b1b45
--- /dev/null
+++ b/devdocs/html/element%2Fhtml.html
@@ -0,0 +1,131 @@
+<header><h1>&lt;html&gt;: The HTML Document / Root element</h1></header><div class="section-content">
+<p>The <code>&lt;html&gt;</code> <a href="../index">HTML</a> element represents the root (top-level element) of an HTML document, so it is also referred to as the <em>root element</em>. All other elements must be descendants of this element.</p> <figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td>None.</td> </tr> <tr> <th scope="row">Permitted content</th> <td> One <a href="head"><code>&lt;head&gt;</code></a> element, followed by one <a href="body"><code>&lt;body&gt;</code></a> element. </td> </tr> <tr> <th scope="row">Tag omission</th> <td> The start tag may be omitted if the first thing inside the <code>&lt;html&gt;</code> element is not a comment.<br>The end tag may be omitted if the <code>&lt;html&gt;</code> element is not immediately followed by a comment. </td> </tr> <tr> <th scope="row">Permitted parents</th> <td>None. This is the root element of a document.</td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/document_role">document</a></td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>No <code>role</code> permitted</td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLHtmlElement"><code>HTMLHtmlElement</code></a></td> </tr> </tbody> </table></div></figure>
+</div>
+<h2 id="attributes">Attributes</h2>
+<div class="section-content">
+<p>This element includes the <a href="../global_attributes">global attributes</a>.</p> <dl> <dt id="manifest">
+<a href="#manifest"><code>manifest</code></a> <abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr> <abbr class="icon icon-nonstandard" title="Non-standard. Check cross-browser support before using."> <span class="visually-hidden">Non-standard</span> </abbr>
+</dt> <dd> <p>Specifies the <a href="https://developer.mozilla.org/en-US/docs/Glossary/URI">URI</a> of a resource manifest indicating resources that should be cached locally.</p> </dd> <dt id="version">
+<a href="#version"><code>version</code></a> <abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr>
+</dt> <dd> <p>Specifies the version of the HTML <a href="https://developer.mozilla.org/en-US/docs/Glossary/Doctype">Document Type Definition</a> that governs the current document. This attribute is not needed, because it is redundant with the version information in the document type declaration.</p> </dd> <dt id="xmlns"><a href="#xmlns"><code>xmlns</code></a></dt> <dd> <p>Specifies the <a href="https://developer.mozilla.org/en-US/docs/Glossary/XML">XML</a> <a href="https://developer.mozilla.org/en-US/docs/Glossary/Namespace">Namespace</a> of the document. Default value is <code>"http://www.w3.org/1999/xhtml"</code>. This is required in documents parsed with XML <a href="https://developer.mozilla.org/en-US/docs/Glossary/Parser">parsers</a>, and optional in text/html documents.</p> </dd> </dl>
+</div>
+<h2 id="example">Example</h2>
+<div class="section-content"><div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="/YF9YBsPYWRtU0XpypCWjUl+FBKomLdjHhoTDXnXwiM=" data-language="html"><span class="token doctype"><span class="token punctuation">&lt;!</span><span class="token doctype-tag">doctype</span> <span class="token name">html</span><span class="token punctuation">&gt;</span></span>
+<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>en<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span>
+ <span class="token comment">&lt;!-- … --&gt;</span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span>
+ <span class="token comment">&lt;!-- … --&gt;</span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
+<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span>
+</pre>
+</div></div>
+<h2 id="accessibility_concerns">Accessibility concerns</h2>
+<div class="section-content">
+<p>While HTML does not require authors to specify <code>&lt;html&gt;</code> element start and ending tags, it is important for authors to do so as it will allow them to specify the <a href="../global_attributes#lang"><code>lang</code></a> for the webpage. Providing a <code>lang</code> attribute with a valid language tag according to <a href="https://datatracker.ietf.org/doc/html/rfc5646" target="_blank">RFC 5646: Tags for Identifying Languages (also known as BCP 47)</a> on the <code>&lt;html&gt;</code> 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.</p> <p>Including a valid <code>lang</code> declaration on the <code>&lt;html&gt;</code> element also ensures that important metadata contained in the page's <a href="head"><code>&lt;head&gt;</code></a>, such as the page's <a href="title"><code>&lt;title&gt;</code></a>, are also announced properly.</p> <ul> <li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Understandable#guideline_3.1_%e2%80%94_readable_make_text_content_readable_and_understandable">MDN Understanding WCAG, Guideline 3.1 explanations</a></li> <li><a href="https://www.w3.org/WAI/WCAG21/Understanding/language-of-page.html" target="_blank">Understanding Success Criterion 3.1.1 | W3C Understanding WCAG 2.1</a></li> </ul>
+</div>
+<h2 id="specifications">Specifications</h2>
+<div class="_table"><table class="standard-table">
+<thead><tr><th scope="col">Specification</th></tr></thead>
+<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">HTML Standard <br><small># the-html-element</small></a></td></tr></tbody>
+</table></div>
+<h2 id="browser_compatibility">Browser compatibility</h2>
+<div class="_table"><table>
+<thead>
+<tr id="bct-browser-type">
+<th></th>
+<th colspan="6">Desktop</th>
+<th colspan="6">Mobile</th>
+</tr>
+<tr id="bct-browsers">
+<th></th>
+<th>Chrome</th>
+<th>Edge</th>
+<th>Firefox</th>
+<th>Internet Explorer</th>
+<th>Opera</th>
+<th>Safari</th>
+<th>WebView Android</th>
+<th>Chrome Android</th>
+<th>Firefox for Android</th>
+<th>Opera Android</th>
+<th>Safari on IOS</th>
+<th>Samsung Internet</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<th><code>html</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">≤12.1</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">≤12.1</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">1.0</td>
+</tr>
+<tr>
+<th><code>manifest</code></th>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-no">3.5–84<details><summary>3</summary>Before version 3.5, Firefox ignores the <code>NETWORK</code> and <code>FALLBACK</code> sections of the cache manifest file.</details>
+</td>
+<td class="bc-supports-yes">10</td>
+<td class="bc-supports-yes">10.6</td>
+<td class="bc-supports-no">4–16.4</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-no">4–84</td>
+<td class="bc-supports-yes">11</td>
+<td class="bc-supports-no">3.2–16.4</td>
+<td class="bc-supports-yes">1.0</td>
+</tr>
+<tr>
+<th><code>version</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">15</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">14</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">1.0</td>
+</tr>
+<tr>
+<th><code>xmlns</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">15</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">14</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">1.0</td>
+</tr>
+</tbody>
+</table></div>
+<h2 id="see_also">See also</h2>
+<div class="section-content"><ul> <li>MathML top-level element: <code><a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math">&lt;math&gt;</a></code>
+</li> <li>SVG top-level element: <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg"><code>&lt;svg&gt;</code></a>
+</li> </ul></div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2005&ndash;2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br>
+ <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html</a>
+ </p>
+</div>