<分区>
.box {
width: 1000px;
height: 500px;
margin-top: 100px;
background: red;
}
<body>
<div class="box">
</div>
</body>
我把box margin-top设置为100px,为什么body没有覆盖全屏?主体充当具有顶部边距的 div。
<分区>
.box {
width: 1000px;
height: 500px;
margin-top: 100px;
background: red;
}
<body>
<div class="box">
</div>
</body>
我把box margin-top设置为100px,为什么body没有覆盖全屏?主体充当具有顶部边距的 div。
最佳答案
试试这段代码,
body {
margin: 0;
}
关于html - 机身不覆盖全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33593925/