Margin overlap problem

two adjacent div elements cause margin overlap.

Since the

margin overlap problem is caused by BFC, why do you assign a div overflow:hidden; attribute? there is still a margin overlap problem.

the method to generate BFC for an element is not to set the element attribute:
1.float: left | right | both;
2.overflow: hidden | auto | scroll;
3.display: table-cell | inline-block | table-caption;
4.position: absolute | fixed;
four methods?

I have tried the situation I have encountered so far, and only float, display: table-caption | inline-block and position can solve it.

Why not the overflow and display:table-cell properties?

Sep.03,2021

confuses "produce" with "place", one internally and the other externally. Change the overflow to let a div announce the new BFC internally, but externally it is still in the original BFC.


overflow is overflowed. If you say overflow is auto, and your boxes are float:left,width: infinitely wide, it will be arranged horizontally all the time, and the BFC of the browser will be disrupted.
display:table-cell is an attribute that allows tag elements to be rendered as table cells, similar to td tags, which turns boxes into cells, meaning that BFC

disrupts the parent box.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5b23b-44580.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5b23b-44580.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?