Skip to main content
D
CSS
CSS Text

CSS Text

CSS formats the layout and spacing of text.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

CSS provides numerous properties to control how text sits on the screen. Developers use these properties to align text, add underlines, transform case, and adjust spacing. This gives complete control over typography.

Example

Example
1/* this formats text */
2h1 {
3  text-align: center;
4  text-decoration: underline;
5  text-transform: uppercase;
6  letter-spacing: 2px;
7}

Key Points

  • The `text-align` property centers or justifies text.
  • The `text-decoration` property adds or removes underlines.
  • The `text-transform` property forces uppercase or lowercase.
  • The `letter-spacing` property changes character gaps.

Up Next

Continue your journey with the next topic.

Go to CSS Fonts