Atributo HTML <html> xmlns
Ejemplo
Un documento XHTML simple, con el mínimo de etiquetas requeridas:
<!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>
Definición y uso
El xmlns
atributo especifica el espacio de nombres xml para un documento.
Nota: el xmlns
atributo es obligatorio en XHTML, no válido en HTML 4.01 y opcional en HTML5.
Nota: El validador de HTML en
http://w3.org no se queja cuando xmlns
falta el atributo en un documento XHTML. Esto se debe a que el espacio de nombres "xmlns=http://www.w3.org/1999/xhtml" es el predeterminado y se agregará a la
<html>
etiqueta incluso si no lo incluye.
Compatibilidad con navegador
Attribute | |||||
---|---|---|---|---|---|
xmlns | Yes | Yes | Yes | Yes | Yes |
Sintaxis
<html xmlns="http://www.w3.org/1999/xhtml">
Valores de atributos
Value | Description |
---|---|
http://www.w3.org/1999/xhtml | The namespace to use (for XHTML documents) |
❮ Etiqueta HTML <html>