
- Guida HTML
- HTML - Home
- HTML - Introduzione
- HTML - Tag Basiliari
- HTML - Elementi
- HTML - Attributi
- HTML - Formattazione
- HTML - Tags Phrase
- HTML - Meta Tags
- HTML - Commenti
- HTML - Immagini
- HTML - Tabelle
- HTML - Liste
- HTML - Link Testuali
- HTML - Link nelle Immagini
- HTML - Link ad Indirizzi Email
- HTML - Frame
- HTML - Iframe
- HTML - Blocchi
- HTML - Sfondi
- HTML - Colori
- HTML - Fonts
- HTML - Form
- HTML - Incorporare Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Fogli di Stile
- HTML - Javascript
- HTML - Layout
- HTML Referenze
- HTML - Riferimenti Tag
- HTML - Riferimenti Attributi
- HTML - Riferimenti Eventi
- HTML - Riferimenti Font
- HTML - Codici ASCII
- Tabella Codici ASCII
- HTML - Colori
- HTML - Entità
- HTML - Rif Font
- HTML - Rif Eventi
- MIME Media Types
- HTML - Coifica URL
- Codici Linguaggi ISO
- HTML - Codifica Caratteri
- HTML - Tag Deprecati
- HTML Risorse Utili
- HTML - Color Code Builder
- HTML - Editor Online
Il tag HTML div
Descrizione
Il tag HTML <div> viene usato per definire una sezione all' interno del documento HTML. Tramite il tag div si potranno raggruppare diversi elementi HTML e stilizzarli tramite CSS.
La differenza fra il tag div e il tag span รจ che il tag div viene usato con blocchi di elementi mentre il tag span viene usato con gli elementi inline (ossia nella stessa riga).
Esempio
<!DOCTYPE html> <html> <head> <title>HTML div Tag</title> <link rel="stylesheet" href="style2.css"> </head> <body> <div id="contentinfo"> <p>Welcome to our website. We provide tutorials on various subjects.</p> </div> </body> </html>
A seguire il contenuto del file style2.css
#contentinfo p { line-height: 20px; margin: 30px; padding-bottom: 20px; text-align: justify; width: 140px; color: red; }
Produrrà il seguente risultato:

Attributi Globali
Questo tag supporta tutti gli attributi globali descritti in - HTML - Referenze Attributi
Attributi Specifici
Il tag HTML <div> supporta anche i seguenti attributi aggiuntivi:
Attributo | Valore | Descrizione |
---|---|---|
autofocus ![]() | autofocus | Imposta un focus automatico. |
Attributi Evento
Questo tag supporta tutti gli attributi evento descritti in - HTML - Referenze Eventi
Compatibilità Browser
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Si | Si | Si | Si | Si | Si |
html_tags_reference.htm
Advertisements