Is it better to use ems/rems than px for font-size?
Publikováno: 10.1.2020
The answer used to be absolutely yes because, if you used px
units, you prevented the text from being resized by the user at all.
But browser zoom is the default method for making everything bigger (including text) these days and it works great even if you use px
.
But... Kathleen McMahon really digs into this and finds that it's still worth setting all your type (both font-size
and line-height
) in relative units because:
- setting type in
px
The post Is it better to use ems/rems than px for font-size? appeared first on CSS-Tricks.
The answer used to be absolutely yes because, if you used px
units, you prevented the text from being resized by the user at all.
But browser zoom is the default method for making everything bigger (including text) these days and it works great even if you use px
.
But... Kathleen McMahon really digs into this and finds that it's still worth setting all your type (both font-size
and line-height
) in relative units because:
- setting type in
px
prevents browser settings from making font size adjustments (which some people definitely use) and - setting type in relative units maintains greater design fidelity as users use browser zoom (which a lot of people definitely use).
Direct Link to Article — Permalink
The post Is it better to use ems/rems than px for font-size? appeared first on CSS-Tricks.