How does the child element margin affect the parent element?

Child element margin affects parent element

Description of the problem: In some cases, when we set the margin value of the child element under the parent element, the parent element will be affected.
This is a common problem and only occurs in standard browsers (FirfFox, Chrome, Opera, Sarfi), IE works fine.

Cause of the problem
insert image description here

Solution: Add CSS code to the parent element

overflow:hidden;

insert image description here

Guess you like

Origin blog.csdn.net/weixin_45357661/article/details/129816396