开发者

Why is the wrapper div getting the top margin applied when applying to its child div?

Here is an example html:

<div id = "wrapper">
   <div id = "content">
   </div>
</div>

here is the CSS:

#wrapper
{
  width:  1000px;
  min-height:  850px;
开发者_StackOverflow中文版  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?


have you removed the margin in the body tag?

<body  marginheight="0" marginwidth="0">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜