Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026
The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.
Beyond fonts, CSS offers many properties to control text appearance and layout.
text-transform
Change the case of text:
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
text-decoration
Add decorations like underlines:
a {
text-decoration: underline;
}
.fancy {
text-decoration: underline dashed blue;
}
Values: underline, overline, line-through, none
You can also set style (solid, double, dotted, dashed, wavy) and color.
text-align
Control horizontal text alignment:
.center { text-align: center; }
.right { text-align: right; }
.justify { text-align: justify; }
line-height
Set the vertical space between lines:
p {
line-height: 1.6;
}
Using a unitless number (like 1.6) is recommended as it scales with font size.
letter-spacing and word-spacing
Adjust spacing between characters or words:
.spaced {
letter-spacing: 2px;
word-spacing: 4px;
}
text-shadow
Add shadows to text:
h1 {
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
Values: x-offset y-offset blur-radius color
text-indent
Indent the first line of a paragraph:
p {
text-indent: 2em;
}
white-space
Control how whitespace is handled:
.nowrap { white-space: nowrap; }
.pre { white-space: pre; }
| Value | Whitespace | Line Breaks |
|---|---|---|
normal | Collapsed | Auto |
nowrap | Collapsed | None |
pre | Preserved | Manual only |
pre-wrap | Preserved | Auto + Manual |
word-break and overflow-wrap
Control how words break:
.break-word {
overflow-wrap: break-word;
}
.break-all {
word-break: break-all;
}
vertical-align
Align inline elements vertically:
img {
vertical-align: middle;
}
Values: baseline, top, middle, bottom, sub, super