HTML <html> Tag

Description

The <html> HTML element is a container that encloses the entire contents of a web page, including the <head> and <body> elements. The opening and closing <html> tags in the document are optional, but a good style dictates their indispensable use. As a rule, <html> comes second in the document, after determining the type of document (Document Type Definition, DTD) set via <!DOCTYPE> . The closing <html> tag is always the last in the document.

Properties

Permitted Parents
None. This is the root element of a document.
Content
<head> and <body>
Start/End Tags
Start tag: optional, End tag: optional

Example

<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>

Attributes

Attribute Definition
version Specifies the HTML DTD version of the document. The version attribute is deprecated - use the <!DOCTYPE> tag instead.
content Specifies the property's value.
scheme Specifies a scheme to use to interpret the property's value (as declared in the content attribute).
http-equiv Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.

Global Attributes

The <html> tag also supports the Global Attributes in HTML5

Event Attributes

The <html> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYesYesYesYesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYesYesYesYesYes