
- 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 <doctype>
Descrizione
Il tag HTML <doctype> serve ad indicare quale versione di HTML utilizza il documento. Fa riferimento al DocumentType Declaration (DTD).
NOTA: Il tag <!DOCTYPE> non ha un tag finale!.
Esempio
<!DOCTYPE html> <html> <head> <title>HTML doctype Tag</title> </head> <body> <p>doctype declaration <doctype> is mentioned at the starting of every HTML document.</p> </body> </html>
Produrrà il seguente risultato:
doctype declaration <doctype> is mentioned at the starting of every HTML document.
Dichiarazioni
HTML 4.01 ha 3 possibili doctypes: HTML 4 Strict, HTML 4 Transitional, e HTML 4 Frameset. Ogni documento HTML che creerete dovrebbe avere una fra queste tre dichiarazioni.
HTML 4 Strict
Questa dichiarazione include tutti gli elementi HTML ad eccezione di quelli che sono stati deprecati, e quelli che appaiono nei documenti frameset.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd">
HTML 4 Transitional
Questa dichiarazione include tutti gli elementi HTML compresi quelli deprecati.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">;
HTML 4 Frameset
Questa dichiarazione include sia tutti gli elementi HTML compresi definiti nel DTD che quelli nel framed document.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "https://www.w3.org/TR/html4/frameset.dtd">
Dichiarazione HTML 5
In HTML5 c'รจ solo una dichiarazione:
<!DOCTYPE html>
Compatibilità Browser
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Si | Si | Si | Si | Si | Si |