HTML <html>Tag


Examples

A simple HTML5 document:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Document Title</title>
</head>

<body>
Document content......
</body>

</html>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <html> tag.


Tag Definition and Usage Instructions

The <html> tag tells the browser that this is an HTML document.

The <html> tag is the outermost element in an HTML document.

The <html> tag is the container of all other HTML elements (except<!DOCTYPE>the <!DOCTYPE> tag).


Differences between HTML 4.01 and HTML5

In HTML5, a new attribute was added: manifest.


Differences between HTML and XHTML

The xmlns attribute is required in XHTML, but not in HTML.

However, even if the <html> in an XHTML document does not use the xmlns attribute, the HTML validator on W3C will not report an error. This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed value, and even if you do not include it, this value will be added to the <html> tag.


Attributes

New: New attribute in HTML5.

Attribute Value Description
manifestNew URL Defines a URL that describes the document's cache information.
xmlns http://www.w3.org/1999/xhtml Not supported in HTML. Only supported in XHTML.Specifies the XML namespace attribute (use this attribute if you need your content to conform to XHTML).


Global Attributes

The <html> tag supportsHTML's Global Attributes。

Other Extensions