HTML <h1> - <h6> alignAttribut
Exemples
Titres HTML centrés :
<h1 align="center">Ceci est le titre 1</h1>
<h2 align="left">Ceci est le titre 2</h2>
<h3 align="right">Ceci est le titre 3</h3>
<h4 align="justify">Ceci est le titre 4</h4>
<h2 align="left">Ceci est le titre 2</h2>
<h3 align="right">Ceci est le titre 3</h3>
<h4 align="justify">Ceci est le titre 4</h4>
Essayez-le vous-même »
Prise en charge des navigateurs
![]()
![]()
![]()
![]()
![]()
Tous les principaux navigateurs prennent en charge l'attribut align.
Définition et utilisation
HTML5 ne prend pas en charge l'attribut align des <h1> - <h6>. Utilisez CSS à la place.
En HTML 4.01, l'attribut align de <h1> - <h6>est obsolète。
L'attribut align spécifie l'alignement horizontal des titres.
Notes de compatibilité
L'attribut align de <h1> - <h6> est obsolète. Utilisez CSS à la place.
Syntaxe CSS : <h1 style="text-align:right">
Dans notre tutoriel CSS, vous pouvez trouver plus de détails surl'attribut text-align.
Syntaxe
<h1 align="left|right|center|justify">
Valeurs d'attributs
| Valeur | Description |
|---|---|
| left | Titre aligné à gauche (par défaut). |
| right | Titre aligné à droite. |
| center | Centrer le titre. |
| justify | Justifier le titre. |
Balise HTML <h1-h6> Autres extensions