Propiedad de sangría de texto CSS
Ejemplo
Sangre la primera línea de texto con diferentes valores:
div.a {
text-indent: 50px;
}
div.b {
text-indent: -2em;
}
div.c {
text-indent:
30%;
}
Definición y uso
La text-indent
propiedad especifica la sangría de la primera línea en un bloque de texto.
Nota: Se permiten valores negativos. La primera línea se sangrará a la izquierda si el valor es negativo.
Valor por defecto: | 0 |
---|---|
Heredado: | sí |
Animable: | si. Leer sobre animable |
Versión: | CSS1 |
Sintaxis de JavaScript: | objeto .style.textIndent="50px" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Property | |||||
---|---|---|---|---|---|
text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
Sintaxis CSS
text-indent: length|initial|inherit;
Valores de propiedad
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 |
páginas relacionadas
Tutorial CSS: Texto CSS
Referencia HTML DOM: propiedad textIndent