Practical difference between rem and em units
2 answers
While em refers to the font size of its direct or closest parent, rem refers only to the html (root) size.
This is the most detailed explanation I can find on this topic. https://j.eremy.net/confused-about-rem-and-em/
+2
source to share
The CSS spec and level 3 values make it clear:
em: Equal to the computed value of the font-size property of the element in which it is used.
rem: Equal to the computed "font-size" value at the root element. If a root element's font-size property value is specified, "rem" units refer to the property's initial value.
+1
source to share