3

I have a simple piece of html code like this

<div class="outer-div">
    <div class="inner-div" style="margin:1em"></div>
</div>

why does margin-top of the inner-div bleed out and not push the it down? If I add a padding top in the outer-div of only 1px, the bleeding stops.

thanks!

Han Che
  • 8,239
  • 19
  • 70
  • 116
  • 1
    this is [margin collapsing](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing) – kukkuz Sep 13 '17 at 13:03

0 Answers0