HTML <ol> type Attribut
Exemple
Une liste ordonnée avec des chiffres romains en majuscules :
<ol type="I">
<li>Café</li>
<li>Thé</li>
<li>Lait</li>
</ol> Plus d'exemples "Essayez-le vous-même" ci-dessous.
Définition et Utilisation
L'attribut type spécifie le type de marqueur à utiliser dans la liste (lettres ou chiffres).
Astuce : La propriété CSS list-style-type offre plus de types que l'attribut type (voir l'exemple ci-dessous).
Support des Navigateurs
| Attribut | |||||
|---|---|---|---|---|---|
| type | Oui | Oui | Oui | Oui | Oui |
Syntaxe
<ol type="1|a|A|i|I"> Valeurs des Attributs
| Valeur | Description |
|---|---|
| 1 | Par défaut. Nombres décimaux (1, 2, 3, 4) |
| a | Liste ordonnée par ordre alphabétique, en minuscules (a, b, c, d) |
| A | Liste ordonnée par ordre alphabétique, en majuscules (A, B, C, D) |
| i | Nombres romains, en minuscules (i, ii, iii, iv) |
| I | Nombres romains, en majuscules (I, II, III, IV) |
Plus d'Exemples
Exemple
Afficher tous les différents types de listes disponibles avec CSS :
<style>
ol.a {list-style-type: armenian;}
ol.b {list-style-type: cjk-ideographic;}
ol.c {list-style-type: decimal;}
ol.d {list-style-type: decimal-leading-zero;}
ol.e {list-style-type: georgian;}
ol.f {list-style-type: hebrew;}
ol.g {list-style-type: hiragana;}
ol.h {list-style-type: hiragana-iroha;}
ol.i {list-style-type: katakana;}
ol.j {list-style-type: katakana-iroha;}
ol.k {list-style-type: lower-alpha;}
ol.l {list-style-type: lower-greek;}
ol.m {list-style-type: lower-latin;}
ol.n {list-style-type: lower-roman;}
ol.o {list-style-type: upper-alpha;}
ol.p {list-style-type: upper-latin;}
ol.q {list-style-type: upper-roman;}
ol.r {list-style-type: none;}
ol.s {list-style-type: inherit;}
</style>