r/csshelp • • Jun 27 '26

Responsive font sizes

I came across the below, when searching for the best way to make sure I get font sizes to be responsive. I always thought it better to use %'s because that would auto adjust. Have I got that right?

Consider Using em or rem Units

While px is perfectly fine and widely used, defining your breakpoints in em or rem (e.g., 48em instead of 768px) is excellent for accessibility. If a user increases their browser's default text size, em-based breakpoints will scale accordingly, preventing your layout from breaking.

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/equinusocio Jul 08 '26 edited Jul 08 '26

REM is relative to the root font size, percentages are relative to the nearest font-size found in the ancestors tree. For this reason percentages in font size are really hard to control in component-based environments.

What's your approach?