Why Accessible CSS Uses REM Instead of Hardcoded Pixels

When a visitor raises their browser's default font size from 16 px to 20 px for better eyesight, hardcoded font-size: 14px ignores their accessibility preference completely. Defining typography and spacing in rem (px ÷ root_px) scales your entire layout harmoniously while keeping exact Figma pixel proportions at the default 16 px root.

Pair this converter with our WCAG 2.1 Color Contrast Checker and CSS Box Shadow Generator when shipping accessible responsive components.

Quick rule: when root font-size stays at the browser standard 16px, every 4px design-system spacing increment maps cleanly to 0.25rem (4px = 0.25rem, 8px = 0.5rem, 16px = 1rem, 24px = 1.5rem).

Why Accessibility Audits Favor REM Over Fixed PX Font Sizes

When a user with low vision sets their browser default font size to 20px or 24px instead of 16px, stylesheets written in rigid px ignore their preference, whereas rem units scale smoothly relative to the root <html> font size. Reserve px for crisp 1px hairline borders and use rem for typography, spacing, and media-query breakpoints.

Frequently Asked Questions

What is 1rem equal to by default?
In all major desktop and mobile browsers, default root font-size is 16px, so 1rem = 16px, 1.5rem = 24px, and 0.875rem = 14px.
What is the difference between em and rem?
rem always multiplies the root html font size, whereas em compounds relative to the immediate parent element's font size.
Should I still use the old 62.5% html font-size hack?
Most modern design systems keep root at 100% (16px) and use direct rem tokens or CSS variables to avoid breaking third-party components.