Imprimir

Manual de HTML: Secciones de un documento HTML

Un documento HTML genérico será similar a:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Hello World</title>
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

Podemos diferenciar tres secciones básicas en un documento HTML:

  1. Declaración de tipo de documento
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
     
    </html>
    • <!DOCTYPE>

      Define el tipo de documento. La primera palabra tras DOCTYPE es el tag raíz, en este caso html.

    • <html></html>

      Indica al navegador el inicio y el final del documento HTML.

  2. Cabecera o head
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Hello World</title>
      </head>
  3. Cuerpo o body
      <body>
        <h1>Hello World</h1>
      </body>

Recursos

Deja un comentario