The CSS rem unit sizes text relative to the root element’s font size. Keeping the root at the browser default lets user font-size preferences take effect; 1rem is usually 16px, though the default can vary. section 4.4.1 section 4.3
Scale text with the root
Set the root to 100%, then size body text at 1rem and an h1 at 2rem. These sizes scale proportionally when users increase their root font size. By contrast, fixed pixel values are generally less adaptable to user preferences. section 4.4.1 section 4.3
:root { font-size: 100%; } #A
body { font-size: 1rem; } #B
h1 { font-size: 2rem; } #C
Use this CSS pattern to keep the root at the browser default and size text with rem. section 4.4.1






