dave
dave

Reputation: 15459

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;
  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?

Upvotes: 1

Views: 1174

Answers (1)

Jim
Jim

Reputation: 829

have you removed the margin in the body tag?

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

Upvotes: 2

Related Questions