3 ms·
The short answer: rem is for global sizing and em is for local or component level sizing.
by alwillis 2y ago
The short answer: rem is for global sizing and em is for local or component level sizing.
- runarberg 2y agoWhy would you deny your self font aware units (such as cap or ex) or inline relative units (such as ch)? Column width form example are very intuitive to see in ch units. 30-42 ch fits roughly 30-42 characters on a line and is nice to read. 120+ ch is too long and is perfect for max-inline-size of a container with a lot of body text. Specifying that in em is kind of just guessing. Then there is viewport relative units such as vw and vh and the new container relative units cqw, cqh etc. and of course %.
- alwillis 2y agoI agree with all of that; I was responding to a comment someone made about only using rems for everything. I probably posted it to the incorrect thread.
- qingcharles 2y agoEvery time a new unit is added I find a use for it almost immediately to clean up my designs and clean up my CSS. I've practically rid myself entirely of media selectors for viewport sizes.