HTML <html> xmlns attribute

Definition and Usage

xmlns The attribute specifies the XML namespace of the document.

Note:In XHTML,xmlns The attribute is required and invalid in HTML 4.01, but optional in HTML5.

Note:The HTML validator at http://w3.org is missing in the XHTML document xmlns No warning will appear when the attribute is set. This is because the namespace "xmlns=http://www.w3.org/1999/xhtml" is the default one, and it will be added to the <html> tag even if you do not include it.

Example

A simple XHTML document containing the minimum necessary tags:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of the Document</title>
</head>
<body>
The content of the document......
</body>
</html>

Try It Yourself

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).

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support