Atributo HTML <html> xmlns
Exemplo
Um documento XHTML simples, com o mínimo de tags necessárias:
<!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>
Definição e uso
O xmlns
atributo especifica o namespace xml para um documento.
Nota: O xmlns
atributo é obrigatório em XHTML, inválido em HTML 4.01 e opcional em HTML5.
Nota: O validador HTML em
http://w3.org não reclama quando o xmlns
atributo está faltando em um documento XHTML. Isso ocorre porque o namespace "xmlns=http://www.w3.org/1999/xhtml" é padrão e será adicionado à
<html>
tag mesmo que você não a inclua.
Suporte ao navegador
Attribute | |||||
---|---|---|---|---|---|
xmlns | Yes | Yes | Yes | Yes | Yes |
Sintaxe
<html xmlns="http://www.w3.org/1999/xhtml">
Valores de atributo
Value | Description |
---|---|
http://www.w3.org/1999/xhtml | The namespace to use (for XHTML documents) |
❮ Tag HTML <html>