#
CSS Properties for Text
This tutorial shows how we can handle text attributes with CSS.
The most used properties we can use for a text are:
color
: used to set the color of the text. The color is specified by:- a color name - like "red"
- a HEX value - like "#ff0000"
- an RGB value - like "rgb(255,0,0)"
background-color
: the color of the background.text-align
: used to set the horizontal alignment of a text. Possible values: center, left, right, justify.text-align-last
: specifies how to align the last line of a text. Possible values: center, left, right, justify.vertical-align
: establishes the vertical alignment of an element. Possible values: baseline, text-top, text-bottom, sub, super.text-decoration
: sets the appearance of decorative lines on text. Possible values: overline, line-through, underline, none.text-decoration-color
: sets the color of the decorationtext-decoration-style
: sets the color of the decoration. Possible values: solid, double, dotted, dashed, wavy.text-transform
: specifies how to capitalize an element's text. Possible values:capitalize
,uppercase
,lowercase
,none
.text-indent
: used to specify the indentation of the first line of a text. Possible values: 5px, -5px.line-height
: specifies the space between lines.word-spacing
: specifies the space between the words in a text.text-shadow
: adds shadow to text.