Latest web development tutorials

HTML html xmlns attribute

HTML html Tag Reference HTML <html> tag

Examples

A simple XHTML document, with a minimum of required tags:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head>

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

</html>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support xmlns attribute.


Definition and Usage

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

xmlns attribute specifies the xml document namespace.

However, if you do not use the xmlns in XHTML documents, http://w3.org the HTML validator can correctly recognize the document. This is because the namespace "xmlns = http: //www.w3.org/1999/xhtml" is the default, it will be automatically added to the <html> tag.


grammar

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

Property Value

描述
http://www.w3.org/1999/xhtml 要使用的命名空间(XHTML 文档)。


HTML html Tag Reference HTML <html> tag