Attributo HTML <html> xmlns
Esempio
Un semplice documento XHTML, con il minimo di tag richiesti:
<!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>
Definizione e utilizzo
L' xmlns
attributo specifica lo spazio dei nomi xml per un documento.
Nota: l' xmlns
attributo è obbligatorio in XHTML, non valido in HTML 4.01 e facoltativo in HTML5.
Nota: il validatore HTML su
http://w3.org non si lamenta quando l' xmlns
attributo manca in un documento XHTML. Questo perché lo spazio dei nomi "xmlns=http://www.w3.org/1999/xhtml" è predefinito e verrà aggiunto al
<html>
tag anche se non lo includi.
Supporto browser
Attribute | |||||
---|---|---|---|---|---|
xmlns | Yes | Yes | Yes | Yes | Yes |
Sintassi
<html xmlns="http://www.w3.org/1999/xhtml">
Valori di attributo
Value | Description |
---|---|
http://www.w3.org/1999/xhtml | The namespace to use (for XHTML documents) |
❮ Tag HTML <html>