<html>


HTML <html> Tag

Instance

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head>

<body>
文档内容......
</body>

</html>

Run Example»

Click the "Run Instance" button to view the online instance


Browser support

1000.png

All major browsers support< html> tag.


Tag definition and usage instructions

<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 a container for all other HTML elements (except the <!DOCTYPE> tag).


Differences between HTML 4.01 and HTML5

In HTML5, a new attribute is added: manifest.


Differences between HTML and XHTML

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

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


Attribute

New: New attribute in HTML5.

PropertiesValueDescription
manifestNew URLDefine a URL that describes the cache information of the document.
xmlnshttp://www.w3.org/1999/xhtmlHTML is not supported. Only XHTML supported. Specify the XML namespace attribute (use this attribute if you need your content to conform to XHTML.).


Global attributes

<html> tag supports global attributes of HTML.