CSS

rem vs em

em is relative to the element's own font size and compounds when nested; rem is relative to the root.

Why interviewers ask about it

Both respect the user's browser font-size setting, unlike px - that is the accessibility argument. rem avoids the compounding surprise.

This term is part of the free Python Full-Stack interview preparation module - browse the full glossary for every definition.