Create new block formatting context
You can use display: flow-root
on the parent element to prevent margin collapsing through the containing element as it creates new Block Formatting Context.
Changing the value of the overflow property to auto or using flexbox will have the same effect.