Convert px to rem
The rem unit is relative to the root (html) element’s font size, so sizing
typography and spacing in rem keeps your layout scalable and respects the user’s
browser font-size preferences for accessibility.
To convert, divide the pixel value by the root font size — with the default 16px root, 24px ÷ 16 = 1.5rem. Enter your numbers above and the result updates instantly, all in your browser.