How it works
Divide pixels by the base font size to get rem. Browsers default to 16px, so 24px is 1.5rem. Change the base if your root font size is different.
Frequently asked questions
Why use rem?
rem scales with the user font-size setting, which helps accessibility.