Typography is the backbone of exceptional digital design. In Tailwind CSS, typography utilities govern font sizing, weights, line heights (leading), letter spacing (tracking), text alignment, and colors with absolute precision.
Tailwind's text-{size} classes automatically pair sensible default line-heights with each font size:
| Class | Font Size | Line Height | Typical Usage |
|---|---|---|---|
text-xs | 0.75rem (12px) | 1rem (16px) | Badges, captions, timestamps |
text-sm | 0.875rem (14px) | 1.25rem (20px) | Secondary text, form helper text |
text-base | 1rem (16px) | 1.5rem (24px) | Body copy default |
text-lg | 1.125rem (18px) | 1.75rem (28px) | Subheadings, lead paragraphs |
text-xl | 1.25rem (20px) | 1.75rem (28px) | Card headers |
text-2xl | 1.5rem (24px) | 2rem (32px) | Section titles |
text-4xl | 2.25rem (36px) | 2.5rem (40px) | Hero titles |
tracking-tighter, tracking-tight, tracking-normal, tracking-wide, tracking-widest.truncate utility class do in Tailwind CSS?font-weight: 700;?text-xl?Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.