In fact, setting display: table actually uses the parent container to form a BFC and display: block does not clear the float. It uses clear: both to clear the float. It is recommended to take a look at this article, if you are interested, you can also study BFC CSS Clear Float (Clear and BFC)
In fact, setting display: table actually uses the parent container to form a BFC
and display: block does not clear the float. It uses clear: both to clear the float.
It is recommended to take a look at this article, if you are interested, you can also study BFC
CSS Clear Float (Clear and BFC)
display:block will cause line breaks
display:table will clear the floating elements before and after, but block will not
Prevent margin merging