HTML <html> xmlns-Attribut

Definition und Verwendung

xmlns Das Attribut legt den XML-Namespace der Dokument fest.

Hinweis:In XHTML:xmlns Das Attribut ist obligatorisch und in HTML 4.01 ungültig, in HTML5 optional.

Hinweis:Der HTML-Validierer unter http://w3.org fehlt in XHTML-Dokumenten xmlns Wenn der Attributwert vorhanden ist, wird keine Warnung ausgegeben. Dies liegt daran, dass der Namespace "xmlns=http://www.w3.org/1999/xhtml" standardmäßig ist und hinzugefügt wird, selbst wenn Sie ihn nicht enthalten.

Example

A simple XHTML document containing the minimum required 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