First we define a div with a length of 500px, and you can think of it as a large box, in order to see it clearly, we'll show the solid line in its frame.
There will be a lot of div inside you can understand a big box with other small boxes
Let's put one first.
You will see
The picture is not complete, you can see this inside div tightly to the top left corner of the big Div
Plus
margin-top:5px;margin-left:5px
Yes
Margin is to set the margin, if set here
margin-right:5px;margin-bottom:5px
No effect.
Because there's nothing behind it and underneath.
Here's a look at the inner margin
Effect a try to see out, very simple
Found a problem in the IE6 and 360 browser in the div set the length and height of the premise, incredibly able to adapt, that is, content no matter how much less, will not burst div, but the original length and height changed
In fact, this is not in line with the norm. Firefox browser is normal.
You can try it out, it's a browser compatibility issue.
Running under Firefox browsing is
The right
In the IE6 browser is
of the wrong
The length and height of a div is the margin (two) + border (two) + padding (two) + content length
Anyway, remember, the long width of the div doesn't mean the long width of the content.
The above is div+css page layout design New Beginning (4) content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!