Quantcast
Viewing all articles
Browse latest Browse all 15

Answer by Artemee Senin for Why does this CSS margin-top style not work?

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.

https://codepen.io/rachelandrew/pen/VJXjEp


Viewing all articles
Browse latest Browse all 15

Trending Articles