Skip to content

Instantly share code, notes, and snippets.

@baeharam
Created February 26, 2020 03:13
Show Gist options
  • Save baeharam/79832bd7fcc9340bc3c6e9c77c363339 to your computer and use it in GitHub Desktop.
Save baeharam/79832bd7fcc9340bc3c6e9c77c363339 to your computer and use it in GitHub Desktop.
BFC - Solve Margin Collapsing
<div class="bfc">
<p>element</p>
<p>element</p>
<div class="new-bfc">
<p>element</p>
</div>
</div>
div {
background-color: blue;
}
p {
margin: 10px 0;
background-color: green;
}
.bfc {
overflow: hidden;
}
.new-bfc {
overflow: hidden;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment