Propriété CSS text-indent
Exemple
Indentez la première ligne de texte avec des valeurs différentes :
div.a {
text-indent: 50px;
}
div.b {
text-indent: -2em;
}
div.c {
text-indent:
30%;
}
Définition et utilisation
La text-indent
propriété spécifie l'indentation de la première ligne dans un bloc de texte.
Remarque : Les valeurs négatives sont autorisées. La première ligne sera en retrait à gauche si la valeur est négative.
Valeur par défaut: | 0 |
---|---|
Hérité: | Oui |
Animable : | Oui. En savoir plus sur l'animation |
Version: | CSS1 |
Syntaxe JavaScript : | objet .style.textIndent="50px" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Property | |||||
---|---|---|---|---|---|
text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
Syntaxe CSS
text-indent: length|initial|inherit;
Valeurs de propriété
Value | Description | Play it |
---|---|---|
length | Defines a fixed indentation in px, pt, cm, em, etc. Default value is 0. Read about length units | |
% | Defines the indentation in % of the width of the parent element | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Pages connexes
Tutoriel CSS : Texte CSS
Référence HTML DOM : propriété textIndent