Etiqueta HTML <html>
Ejemplo
Un documento HTML simple:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Definición y uso
La <html>
etiqueta representa la raíz de un documento HTML.
La <html>
etiqueta es el contenedor de todos los demás elementos HTML (excepto la
etiqueta <!DOCTYPE> ).
Nota: Siempre debe incluir el
atributo lang<html>
dentro de la
etiqueta, para declarar el idioma de la página web. Esto está destinado a ayudar a los motores de búsqueda y navegadores.
Compatibilidad con navegador
Element | |||||
---|---|---|---|---|---|
<html> | Yes | Yes | Yes | Yes | Yes |
Atributos
Attribute | Value | Description |
---|---|---|
xmlns | http://www.w3.org/1999/xhtml | Specifies the XML namespace attribute (If you need your content to conform to XHTML) |
Atributos globales
La <html>
etiqueta también es compatible con los atributos globales en HTML .
páginas relacionadas
Tutorial de HTML: Introducción a HTML
Referencia HTML DOM: Objeto HTML
Configuración predeterminada de CSS
La mayoría de los navegadores mostrarán el <html>
elemento con los siguientes valores predeterminados:
html {
display: block;
}
html:focus {
outline: none;
}