43 ms·
Thanks. What about em?
by Kiro 11y ago
Thanks. What about em?
- coldtea 11y agoEm (which we use to have for lots of years now IIRC), is the same thing, but instead of being responsive to the top level font size, they are responsive to their first sized parent. So, inside a DIV with font-size: XXpx, em sized sub-elements will change size with respect to XX etc. So to size them you have to target their px-sized-parents across your document. Whereas rem sized items you control from a central single value: the font-size of the "html" element. In this sense a page full of em-sized elements will behave the same as a page full of rem-sized elemements if the only pixel sized element in the page is the "html" node.
- sooheon 11y agoThanks for this simple explanation.