Lesson 8 of 3027%

(Progress persistence is disabled until Phase 9)

Tailwind CSS
Beginner

Font Size

Controlling the size of text.

Use text-{size} utilities to control the font size.

Sizes

  • text-xs
  • text-sm
  • text-base (default)
  • text-lg
  • text-xl
  • text-2xl, text-3xl, text-4xl, etc.
<h1 class="text-4xl">Huge Heading</h1>
<p class="text-base">Normal paragraph.</p>
<small class="text-xs">Tiny text.</small>

Tailwind automatically adjusts line-height for each font size.

Try It Yourself

Lesson Progress

Take QuizBuild a Tailwind CSS Project