This article is about <html>, the root element of any HTML document. For other uses, see HTML (disambiguation).

The <html> element contains the entire structure of any HTML document, and its first child must be a <head> element, followed by a <body> element. See the tutorial for an introduction to making HTML documents.

Example code

<!DOCTYPE html>
     <title>The title</title>
      [other head content]
      [body content]



On most user agents, the <html> element has no visual appearance apart from being a container for the <body> element.

Typical CSS representation:

html {
    display: block;

Typical webmail clients remove the <html> element when displaying an HTML-formatted email.

Coding rules

The <html> element is the root element of a document, or the root of a subdocument. It can only contain one <head> element followed by one <body> element.

Both the start and end tags are optional. The <html> element is automatically generated when the tags are not used.

HTML5 requires the start tag if the element's first child is a comment, and requires the end tag is the element is followed by a comment.[1] For example:

<!doctype html>
  <!-- the html start tag is required because of this comment -->
<!-- the html end tag is required because of this comment -->



External links

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.