为什么包装 div 在应用于其子 div 时会应用上边距?
这是一个 html 示例:
<div id = "wrapper">
<div id = "content">
</div>
</div>
这是 CSS:
#wrapper
{
width: 1000px;
min-height: 850px;
border: 1px solid;
}
#content
{
height: 450px;
float: left;
margin: 50px 0px 0px 0px;
}
那么当您在浏览器中查看时,包装器 div 正在应用边距?这是为什么?
Here is an example html:
<div id = "wrapper">
<div id = "content">
</div>
</div>
here is the CSS:
#wrapper
{
width: 1000px;
min-height: 850px;
border: 1px solid;
}
#content
{
height: 450px;
float: left;
margin: 50px 0px 0px 0px;
}
So when you look in the browser, the wrapper div is getting the margin applied to it? why is that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您删除了 body 标签中的边距吗?
have you removed the margin in the body tag?