CKTIS / HTML
html — the document root element
The `html` element is the root of an HTML document. It contains `head` followed by `body`; its `lang` attribute identifies the document language.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<html lang="en">
<head>…</head>
<body>…</body>
</html>The html element represents the root of an HTML document. Its content model is a head element followed by a body element. head holds metadata, while body holds the document's content.
html supports global attributes. Specifying lang is encouraged so speech synthesis and translation tools can choose suitable pronunciation and language rules. In the example, lang="en" identifies English. The element's DOM interface is HTMLHtmlElement.
In text/html syntax, the start tag may be omitted if the first thing inside the element is not a comment. The end tag may be omitted if the element is not immediately followed by a comment. The example writes both tags explicitly for readability.
Examples
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Root element example</title>
</head>
<body>
<p>Hello, HTML!</p>
</body>
</html>Result
Hello, HTML!
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.