Does the <html> element have a default margin or padding in any browser, since normalize.css doesn't reset it?

前端 未结 3 1628
天命终不由人
天命终不由人 2020-12-03 19:42

I\'m using normalize.css, and I saw that it doesn\'t reset margins or padding for the element. Since I assume they\'ve done their research I was wo

3条回答
  •  一个人的身影
    2020-12-03 20:14

    No specification prevents browsers from having a default nonzero padding or margin on the html element. Neither does any specification require or even suggest such defaults, and browsers are not known to have them. On the other hand, if some browser vendor decides otherwise, they probably have a good reason to do so, and we had better not interfere unless we know what we are doing.

    So there is really no reason to reset padding and margin on the html element.

提交回复
热议问题