I know about two reasons why we used to use em
or rem
for font sizes:
- Some obsolete browsers could not zoom the page otherwise and
- Some websites roll their own zoom controls (because the designer was unaware of the browser functionality or wanted it more prominent or whatever) by changing the font size of the
body
None of those are real reasons on a modern website with a reasonably tech-savvy user base.
Are there any real reasons to still use em
or rem
instead of for examle px
? px
for example has the advantage of being a unit that directly conveys what the text would approximately look like.
Is there some functionality that would break? Some relation with screen DPI settings or the like? I am only asking about settings that I could try out right now on a recent Chrome, Firefox or Safari on Windows, Android or iOS... not about some obscure browsers or niche systems.