What is REM?
font size of the root element
Equal to the computed value of ‘font-size’ on the root element.
When specified on the ‘font-size’ property of the root element, the ‘rem’ units refer to the property's initial value.
html {
font-size: 62.5%;
}
Now you've a base size of 62.5% to go.
If 62.5%
is 10px
, then:
you can use 1.6rem
as 16px
.
and don't bother with which context should I take into account, or whatsoever em & px's problems. Now you only refer to the size of html
root element.