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>
<html>
<head>
<title>The title</title>
[other head content]
</head>
<body>
[body content]
</body>
</html>
Attributes[]
- Global HTML attributes
- manifest: URL
Rendering[]
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>
<html>
<!-- the html start tag is required because of this comment -->
...
</html>
<!-- the html end tag is required because of this comment -->
References[]
External links[]
Sectioning elements |
---|