Tailwind CSS Course
Tailwind CSS
/
Beginner

Font Size

Definition

Utilities for controlling the font size of an element.

Explain Like I'm New

Tailwind uses a t-shirt sizing scale. `text-xs` is tiny. `text-base` is normal paragraph text (16px). `text-2xl` is a heading. `text-9xl` is a gigantic hero billboard text.

Real World Example

Creating a clean typographic hierarchy: `text-3xl` for the H1, `text-xl` for the H2, and `text-base` for the paragraphs.

Common Use Cases

  • •Typography
  • •Headers

Interactive Example

Interview Questions

basic

  • What is the default font size class in Tailwind (equal to 16px)?

intermediate

  • What second CSS property does Tailwind magically apply when you use a `text-*` size class?

Flash Cards

Question

Default size?

Click to reveal answer
Answer

`text-base`

Question

Second property?

Click to reveal answer
Answer

Line height! Tailwind automatically pairs every font size with a mathematically perfect line-height (e.g., `text-sm` automatically gets a tighter line-height than `text-9xl`).