HTML Class Notes 9

Box: content area (content)
border: (border)
inner margin: (padding)
outer margin: (margin)
automatic: (auto)
background color: (background)
outer margin merge: set margin between two adjacent boxes at the same time , The final value is the largest one;
avoid merging the margins of adjacent boxes: only set the margins for one of the boxes.

Collapse of outer margin: Set the margin between the two nested boxes at the same time, and the final value is also the largest one to avoid collapse of the outer margin of the nested box: add a border to the parent box, or add padding, or add overflow: hidden;

Guess you like

Origin blog.csdn.net/huanhangDJH/article/details/114669984