Changes the text color using names, HEX, or RGB.
h1 { color: blue; }
Sets the size of text (px, em, rem, %).
h1 { font-size: 40px; }
Changes the font style (Arial, Verdana, etc.)
h1 { font-family: 'Arial'; }
Aligns text horizontally.
| Value | Meaning |
|---|---|
| left / right | Align to sides |
| center | Center text |
| justify | Equal spacing |
Controls the capitalization of text.
| Value | Result |
|---|---|
| uppercase | ALL CAPS |
| lowercase | all small |
| capitalize | First Letter Capital |
h1 { text-transform: uppercase; }
Controls the vertical space between lines of text.
p { line-height: 30px; }
Controls the space between characters.
p { letter-spacing: 3px; }
This paragraph uses increased line height and letter spacing for better readability.
Adds space to the beginning of the first line.
p { text-indent: 50px; }
Changes the color of the paragraph text.
p { color: green; }
The first line of this green paragraph is pushed inside using the text-indent property.