html

FilterElements

<html> ... </html>

This is the root element of HTML and XHTML documents, meaning all other elements are contained within it. The html element has no ancestors. The opening <html> tag is placed at beginning of the document, just after the document type declaration. The closing tag goes at the end of the document. In HTML, if the tags are omitted, html is still implied as the root element.

Start/End Tags

HTML: Optional/Optional;
XHTML: Required/Required

Specifications

  • HTML 4.01
  • HTML5

id=

Values: text
XHTML and HTML5 only. Assigns a unique identifying name to the element.

manifest=

Values: URL
HTML5 only. Points to a cache used with the offline web application API.

version=

Values: -//W3C//DTD HTML 4.01//EN
Deprecated in HTML 4.01. Not in HTML5. In HTML, the value of version is a Formal Public Identifier (FPI) that specifies the version of HTML the document uses (the value above specifies 4.01). In HTML 4.01, the version attribute is deprecated because it is redundant with information provided in the DOCTYPE declaration. In XHTML 1.0, the value of version has not been defined.

xmlns=

Values: http://www.w3.org/1999/xhtml
Required for XHTML only. In an XHTML document, this declares the XML namespace for the document.
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/HTML4.01/strict.dtd">
<html>
  <head>
    <title>Document Title</title>
  </head>
  <body>
    <p>Content of document . . . </p>
  </body>
</html>
XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/
xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
  <head>
    <title>Document Title</title>
  </head>
  <body>
    <p>Content of document . . . </p>
  </body>
</html>

Rendered Example

html gives the document structure (it is the root element) and does not render.