Let's talk about the problem of internal and external margin merging.
The lower margin of layer A is 20px
Look at the picture below
The green layer above the outer margin is changed to 10px
No difference.
In short, margin merging means that when two vertical margins meet, they form an outer margin. The height of the merged margin is equal to the greater of the two of the height in which the merged margins occur.
Looking at the picture
What if the PX is the same? If it's all 20px,
The effect is still the same OH
Let's test it.
Display of IE6
The display of Firefox
It can be seen that IE6 is not merged, and the combination of Firefox
Someone might be curious.
Why does this red not snap to the top of the navigation box
In fact, no browser has a default internal and external margins
only need
See
Some browsers may want to use
body{margin:0;padding:0;}
The above is div+css page layout design New Beginning (5) content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!