CSS Text
CSS text properties define the appearance of text, including color, alignment, decoration, transformation, and spacing.
CSS Text Formatting
CSS provides a lot of properties for formatting text.
Example 1: Text Color
The color property is used to set the color of the text.
This text is blue.
This text is green.
Example 2: Text Alignment
The text-align property is used to set the horizontal alignment of a text.
Centered Heading
Left aligned text.
Right aligned text.
Justified text stretches the lines so that each line has equal width (like in newspapers and magazines).
Example 3: Text Decoration
The text-decoration property is used to set or remove decorations from text.
No decoration (often used to remove underlines from links).
Overline text.
Line-through text.
Underline text.
Example 4: Text Transformation
The text-transform property is used to specify uppercase and lowercase letters in a text.
uppercase text.
LOWERCASE TEXT.
capitalize text.
Example 5: Text Spacing
CSS properties for text spacing include text-indent, letter-spacing, line-height, word-spacing, and white-space.
Text indentation.
Letter spacing.
Line height (spacing between lines).
Word spacing.