Ems to Pixel Conversion - Why 62.5% and not 6.25%?

前端 未结 9 1786
不思量自难忘°
不思量自难忘° 2021-02-05 19:17

I know that a lot of us are familiar with setting the font size on the body element in our CSS to 62.5%. This means that 1em will equal 10px and helps for keeping things pixel p

9条回答
  •  青春惊慌失措
    2021-02-05 20:06

    The conversion may be simpler, but an em wouldn't mean what it is supposed to mean.

    1em is supposed to be equal to the width if a capitalized "M" in a given font. If the width of the letter M is 1 pixel, your font is going to be unreadable.

    http://en.wikipedia.org/wiki/Em_(typography)

提交回复
热议问题