Accessibility Specialist. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
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)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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)