DEV Community

[Comment from a deleted post]
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

So purely for font sizes / measurements the REM unit is based on the font size set at the root of the document (not :root I mean the html element).

So if you set the font size on the html element it will adjust all font sizes using rem units accordingly.

2.5rem is just saying 2.5 times the font size set on the html element.

We use percentages as then if a user sets the browser size to extra large 1.5 times it takes that into account. (So in the example you would get a base font size of 1.2 (80% of 1.5) and your heading using 2.5REM would now be 3 times effectively (1.2 *2.5)