HTML5: nuova semantica per le liste di definizione

HTML5: nuova semantica per le liste di definizione

Le liste di definizione sono state completamente riviste nelle specifiche HTML5 per quanto concerne la loro semantica. Alla luce di questi cambiamenti, molti degli usi attuali di questi elementi sono da rivedere.

Nelle specifiche HTML 4.01 si affermava:

Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.

Another application of DL, for example, is for marking up dialogues, with each DT naming a speaker, and each DD containing his or her words.

Nelle specifiche HTML5, invece, nessun uso esteso viene assegnato alle liste di definizione: l'unico uso previsto è quello dato dal binomio termine/definizione.

The dl element represents a description list, which consists of zero or more term-description (name-value) groupings; each grouping associates one or more terms/names (the contents of dt elements) with one or more descriptions/values (the contents of dd elements).

Quindi usi come quello di marcare dialoghi, chat, interviste o elementi dei form sono stati del tutto deprecati in favore di un ritorno alle origini che vede uno più termini associati ad una o più definizioni.

Torna su