开发者

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

开发者 https://www.devze.com 2023-02-21 19:46 出处:网络
Here is an example html: <div id = \"wrapper\"> <div id = \"content\"> </div> </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

精彩评论

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