3 ms·
ch is based on the width of a "0" character, em is based on the font size, which is the height of the character. for setting widths of things that contain text
by SpaceNugget 6y ago
ch is based on the width of a "0" character, em is based on the font size, which is the height of the character. for setting widths of things that contain text ch makes more sense. For padding, spacing, font sizes, inline symbols, and that kind of thing, em makes more sense.
- desert_boi 6y agoAn em is historically based off the width of the letter M in a typeface. https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align https://iamvdo.me/en/blog/css-font-metrics-line-height-and-v... is a fun deep dive into font sizing, which is pretty hairy.
- 22c 6y agoThat was my understanding as well. em was used for width and ex used for height.