Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

<html>: The HTML Document / Root element

BaselineWidely available

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

Attributes

This element includes theglobal attributes.

versionDeprecated

Specifies the version of the HTMLDocument 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 theXMLNamespace of the document. Default value is"http://www.w3.org/1999/xhtml". This is required in documents parsed with XMLparsers, and optional in text/html documents.

Accessibility

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 thelang for the webpage. Providing alang attribute with a valid language tag according toRFC 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 validlang 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.

Example

html
<!doctype html><html lang="en">  <head>    <!-- … -->  </head>  <body>    <!-- … -->  </body></html>

Technical summary

Content categoriesNone.
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.
Permitted parentsNone. This is the root element of a document.
Implicit ARIA roledocument
Permitted ARIA rolesNorole permitted
DOM interfaceHTMLHtmlElement

Specifications

Specification
HTML
# the-html-element

Browser compatibility

See also

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

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp