Apart from the various CSS font properties, there are other properties that can use to style your text.
For example, you can change the color of text, align text, add decoration properties and many more.
Following are the CSS text properties:
The color property is defined to set the color of the text.
Text-color can be set by using the name “blue”, hex value “#0000ff” or by its RGB value “rgb( 0, 0, 255)”.
The text-align property is defined to set the horizontal alignment of a text.
The values for this property are: left, right, center, justify, and inherit.
In justified alignment, the line is stretched so that every line has equal width, and the left and right margins are straight.
Text decoration property is used to add or remove decorations from the text.
By using underline, overline, and line-through you can add the decoration. And set “none” to remove the decoration.
Text transformation property is used to set the case of text, uppercase or lowercase.
Text transformation can be uppercase, lowercase or capitalize.
Capitalize is used to change the first letter of each word to uppercase.
The text-indent property is defined to set the indentation of the first line of text of an element.
You can give the values for the text-indent property are: percentage (%), length (specifying indent space) or inherit.
The word-spacing property is used to set the spacing between the words.
The letter-spacing property is used to add or subtract space between the characters of the text.
The CSS line-height property is used to set the height of a line of text.
Negative values for this property are not allowed.
The direction property is used to specify the text direction of an element
In this example, “rtl” is right to left direction and “ltr” is left to right direction.
The text-shadow property is used to add the shadow to text.
In this example, 2px is the position of the horizontal shadow, 1px is the position of the vertical shadow and blue is the color of the shadow.
The white-space property describes how white-space inside an element is handled.
The possible values are: normal, nowrap, pre, pre-line, pre-wrap, initial, inherit.
The vertical-align property is used to set the vertical alignment of an element. By using this property, you can set an image position as middle, top, bottom, etc.
The possible values are: baseline, top, bottom, middle, sub, super, text-top, text-bottom, initial, inherit, and you can give the length also.