3 ms·
It gets worse, I had to follow up[0] on what you've said, but if the parent element is also using EM the size keeps increasing. Namely according to the MDN doc
by giancarlostoro 6y ago
It gets worse, I had to follow up[0] on what you've said, but if the parent element is also using EM the size keeps increasing.
Namely according to the MDN docs I read:
> To recap, the em unit means "my parent element's font-size" in the case of typography. The <li> elements inside the <ul> with a class of ems take their sizing from their parent. So each successive level of nesting gets progressively larger, as each has its font size set to 1.3em — 1.3 times its parent's font size.
So REM is what you probably want if you intend to do some nesting and use the parents root font-size, set it once, apply it everywhere. TIL what em really does, versus what rem does.
[0]: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_...