HTML <html> xmlnsAttribute

HTML html 标签参考手册HTML <html> Tag

Example

A simple XHTML document with the minimum required tags:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>Document Title</title>
</head>

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

</html>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the xmlns attribute.


Definition and Usage

Note:In XHTML, the xmlns attribute is required. In HTML, the xmlns attribute is invalid.

The xmlns attribute specifies the XML namespace for the document.

However, if xmlns is not used in an XHTML document, http://w3.orgThe HTML validator can also correctly identify the document. This is because the namespace "xmlns=http://www.w3.org/1999/xhtml" is the default and will be automatically added to the <html> tag.


Syntax

<html xmlns="http://www.w3.org/1999/xhtml">

Attribute Value

Value Description
http://www.w3.org/1999/xhtml The namespace to be used (for XHTML documents).


HTML html 标签参考手册HTML <html> Tag Other Extensions