css learning---margin merge (collapse) problem

When using margins to define the vertical margins of block elements, the margins may merge.

1. Merging of the vertical margins of adjacent block elements

Insert picture description here

2. Combining the vertical margins of nested block elements

Insert picture description here

Guess you like

Origin blog.csdn.net/pilgrim_121/article/details/111869680