Why margin-top of the top div would apply to `<body>`?

后端 未结 7 1594
长情又很酷
长情又很酷 2020-12-15 21:26

Here I posted a demo http://jsfiddle.net/LxYMv/1/.

As you can see gets margin-top:10px from the top div, and therefor

相关标签:
7条回答
  • 2020-12-15 21:51

    You can get around this by adding padding: 0.01px; to the <body>. As it's so small it is effectively rounded to 0px, but the body then starts where it should.

    0 讨论(0)
提交回复
热议问题