What is the em font-size unit? How much is it in pixels?

前端 未结 8 1177
孤独总比滥情好
孤独总比滥情好 2020-12-02 12:30

I want to know what the em unit is, and how much 1em is when converted to pixels (px). I also read somewhere about some IE bug, to overcome which b

8条回答
  •  借酒劲吻你
    2020-12-02 13:03

    this link can help you http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css

    As quoted from that article:

    We know that 1em is always equal to the font size of the parent element, therefore:

    1 ÷ parent font-size × required pixel value = em value
    

    For your bookmarks: Pixel to ems conversion table for font sizes.

提交回复
热议问题