body { font-size: 100.01%; } vs body { font-size: 100%; }?

后端 未结 3 1073
遇见更好的自我
遇见更好的自我 2021-02-02 15:18

What should i keep for body, {font-size: 100.01%; } or { font-size: 100%; }?

what is {font-size: 100.01%; }? and is i

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 15:52

    The declaration body (or html) { font-size: 100.01% } compensates rounding errors, in particular in older versions of Opera and Safari. Both would otherwise display fonts that are too small.

    A relative font-size (%, em) is always interpreted relative to the font size of the parent element. So it's not a bad idea to implement kind of a initial reset in the top element, which you can achieve with body {font-size: 100%}.

提交回复
热议问题