long story short- Please correct me if im wrong !
is it right to say that if there is no padding between the elements, and the only thing separating them are margins, these margins will collapse to the highest value ?
IE: if there is a margin of an element A ( a div box per say) of 20 px ; and another margin of an element B of 30 px ;
the 2 above margins will collapse to form one margin of 30 px ?
i am just trying to verify what i understood from this vid, appreciate your help! thanks !
Steven Parker204,006 Points
You have the right basic idea, but be aware that there are different types of margin collapse: between adjacent siblings, and between parent and first or last child elements, and empty blocks. These each have slightly different rules.
For complete details, see this MDN page on Mastering Margin Collapsing.
thank u both !