Responsive text
Responsive text ensures that font size and typography remain readable and aesthetic on all devices. The goal is for text not to be too small on mobile, but not too large on desktop either.
Media query-based solution
The simplest way to create responsive text is by using media queries. We can set different font sizes for different screen sizes.
In the following example, the heading font size increases above 768px and again above 1200px.
Modern solution: clamp()
The clamp() function allows us to define a minimum, a preferred, and a maximum value. This way, the text scales fluidly according to the screen size.
Comparison of different methods
Responsive text can be achieved in several ways: with media queries, with relative units (em, rem, vw), or with modern CSS functions such as clamp().
| Method | Description |
|---|---|
| Media queries | We define separate rules for different screen sizes. |
| Relative units | We use units such as em, rem, or vw, which scale automatically. |
| clamp() | We define minimum, ideal, and maximum sizes simultaneously. |
Tips for responsive text
Responsive text improves readability and user experience. Here are some tips for proper usage:
- Always test text on multiple devices to ensure it looks good everywhere.
- Use relative units (em, rem, vw) instead of fixed px.
- With clamp(), you can provide both flexibility and controlled scaling.
✨ Ask Lara — your AI study partner
Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.
Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.


