5 avril 2026 à 8h20
Basic syntax
HTML description lists (AKA definition lists) are created with this syntax:
; Term being described
: Description / Definition of that term
; Another term
: Another description / definition
Affichera ceci :
- Term being described
- Description / Definition of that term
- Another term
- Another description / definition
Code HTML correspondant :
<dl><dt>Term being described</dt><dd>Description / Definition of that term</dd><dt>Another term</dt><dd>Another description / definition</dd></dl>
Multiple terms and descriptions
You can create multiple descriptions for a term, or multiple terms for a single description:
; Mouse
: A rodent with a small body and a long tail
: A pointing device used to interact with a computer
; Apple
; Pear
: A type of fruit belonging to the Rosaceae family
Affichera ceci :
- Mouse
- A rodent with a small body and a long tail
- A pointing device used to interact with a computer
- Apple
- Pear
- A type of fruit belonging to the Rosaceae family
Code HTML correspondant :
<dl><dt>Mouse</dt><dd>A rodent with a small body and a long tail</dd><dd>A pointing device used to interact with a computer</dd><dt>Apple</dt><dt>Pear</dt><dd>A type of fruit belonging to the Rosaceae family</dd></dl>
Nested description lists
Description lists may also be nested to create lists within lists:
; Coffee
: A beverage prepared from roasted coffee beans
:; Black coffee
:: Coffee served without any additives
:; Milk coffee
:: Coffee combined with steamed or frothed milk
::; Latte
::: A coffee made with espresso and steamed milk
; Tea
: A beverage typically made from tea leaves
Affichera ceci :
- Coffee
- A beverage prepared from roasted coffee beans
- Black coffee
- Coffee served without any additives
- Milk coffee
- Coffee combined with steamed or frothed milk
- Latte
- A coffee made with espresso and steamed milk
- Tea
- A beverage typically made from tea leaves
Code HTML correspondant :
<dl><dt>Coffee</dt><dd>A beverage prepared from roasted coffee beans<dl><dt>Black coffee</dt><dd>Coffee served without any additives</dd><dt>Milk coffee</dt><dd>Coffee combined with steamed or frothed milk<dl><dt>Latte</dt><dd>A coffee made with espresso and steamed milk</dd></dl></dd></dl></dd><dt>Tea</dt><dd>A beverage typically made from tea leaves</dd></dl>