Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Struttura del Documento HTML Spiegata | Fondamenti di Html
Practice
Projects
Quizzes & Challenges
Quiz
Challenges
/
Fondamenti di HTML

bookStruttura del Documento HTML Spiegata

Scorri per mostrare il menu

Un documento HTML segue una struttura coerente composta da alcuni elementi chiave.

Tag <html>

L'elemento radice di ogni pagina. Tutto il contenuto va inserito tra il tag di apertura <html> e quello di chiusura </html>.

<html>
  <!-- Other elements go here -->
</html>

Tag <head>

Contiene informazioni sulla pagina, non visibili all'utente. Include il titolo, i metadati e i collegamenti a fogli di stile o script.

<head>
  <title>Title of the Document</title>
  <meta charset="UTF-8" />
  <!-- Other meta tags, links, and scripts go here -->
</head>

Elementi comuni in <head>:

  • <title>: testo mostrato sulla scheda del browser;
  • <meta charset="UTF-8">: imposta la codifica del testo;
  • <meta name="description">: breve descrizione della pagina;
  • <meta name="viewport">: necessario per il design responsivo.

Tag <body>

Contiene tutto ciò che è visibile sulla pagina: testo, immagini, link, moduli, ecc.

<body>
  <h1>Hello, World!</h1>
  <p>This is a paragraph of text.</p>
  <!-- Other content goes here -->
</body>

Dichiarazione del tipo di documento

Indica al browser di utilizzare lo standard HTML5 durante la visualizzazione della pagina.

<!DOCTYPE html>

Esempio di struttura completa

Per concludere, raccogliamo tutti gli elementi considerati e combiniamoli in un unico documento HTML.

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the Document</title>
    <meta charset="UTF-8" />
    <!-- Other meta tags, links, and scripts go here -->
  </head>

  <body>
    <h1>Hello, World!</h1>
    <p>This is a paragraph of text.</p>
    <!-- Other content goes here -->
  </body>
</html>

Di seguito, puoi vedere come appare il documento HTML nel browser web.

1. Quale tag rappresenta l’elemento radice di un documento HTML?

2. Cosa contiene il tag <head>?

3. Cosa definisce il tag <title>?

4. Qual è lo scopo del tag <body>?

question mark

Quale tag rappresenta l’elemento radice di un documento HTML?

Select the correct answer

question mark

Cosa contiene il tag <head>?

Select the correct answer

question mark

Cosa definisce il tag <title>?

Select the correct answer

question mark

Qual è lo scopo del tag <body>?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 1

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Sezione 2. Capitolo 1
some-alt