DEV Community

Discussion on: How to decide CSS units for responsive website?

darkwiiplayer profile image

The important difference is that em ultimately depends on the user agent configuration, which may take into account the device and user preferences. That is, unlike we set a font-size to an absolute value somewhere, which is a big no in most cases.

Also, many elements change font-size; say your h1 has a font-size of 1.8em and your a.buttom has an outline of .2em, so a button in a heading will get a thicker outline than in the main text, according to the difference in font-size.