CSS text formatting allows us to customize the appearance of text: we can set color, size, alignment, letter spacing, decorations, and line spacing. These settings play a key role in readability and visual experience.
For text we can define color, font size, and alignment. These properties determine the initial visual impression of the text.
In the following example, the paragraph is given a dark blue color, 18px font size, and center alignment:
With the <text-align> property, text can be aligned left, right, center, or justified.
With <text-transform> we can make text uppercase, lowercase, or capitalize it. <text-decoration> allows for underlining or strikethrough, while <letter-spacing> controls spacing between characters.
In the following example, the text appears fully uppercase, underlined, and with extra letter spacing:
The <line-height> property sets the distance between lines, while <word-spacing> controls the spacing between words. These are important tools for improving text readability.
The following example sets a line height of 1.8 and word spacing of 5px for the text:
With <text-shadow> you can add shadow to text, making it stand out or decorate it.
With the <white-space> and <word-break> properties, you can control when text breaks onto a new line or how it handles long words.
The following advice helps to make text readable and aesthetically pleasing:
Please sign in to ask Lara about CSS text.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.