logoalt Hacker News

cynicalsecuritytoday at 2:55 PM2 repliesview on HN

What happened to em?


Replies

masfuertetoday at 3:24 PM

That's what I wondered. I found the spec*. I'd vaguely thought that 1em was the width of "M" but apparently it's just the font-size, and the connection between font-size and the actual size of the text is very font dependent.

So 1ch is defined to be the advance width of "0" (zero), so it's actually telling you something about the current font.

* https://www.w3.org/TR/css-values-4/#font-relative-lengths

show 1 reply
micromacrofoottoday at 5:10 PM

designers don't like doing math