0

This is a very basic question, but I have always wonder why?

I have this html code:

div {
  margin: 20px;
  height: 100px;
  background: papayawhip;
}
<body>
  <div>Hello world!</div>
</body>

Margin collapse applies up until the body element and stops in the html element.

why?, It's because the root scope for margin collapse it's the html?

Jose Paredes
  • 3,882
  • 3
  • 26
  • 50
  • 2
    https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing It's collapsing margins, just google it – Huangism Oct 23 '17 at 15:30
  • @Huangism Ofc I did!, but I didn't know how to search about this! thanks tho, I have updated my question, does it make sense? – Jose Paredes Oct 23 '17 at 16:08

0 Answers0