https://webdesign.tutsplus.com/tutorials/comprehensive-guide-when-to-use-em-vs-rem--cms-23984
em
vs. rem
DifferenceTranslation of rem
units to pixel value is determined by the font size of the html element.
This font size is influenced by inheritance from the browser font size setting unless explicitly
overridden with a unit not subject to inheritance.
Translation of em
units to pixel values is determined by the font size of the element they’re used on.
This font size is influenced by inheritance from parent elements unless explicitly overridden with a
unit not subject to inheritance.
rem
and em
units are computed into pixel values by the browser, based on font sizes in your design.em
units are based on the font size of the element they’re used on.rem
units are based on the font size of the html element.em
units can be influenced by font size inheritance from any parent elementrem
units can be influenced by font size inheritance from browser font settings.em
units for sizing that should scale depending on the font size of an element other than the root.rem
units for sizing that doesn’t need em units, and that should scale depending on browser font size settings.rem
units unless you’re sure you need em units, including on font sizes.rem
units on media queriesem
or rem
in multi column layout widths - use % instead.em
or rem
if scaling would unavoidably cause a layout element to break.