Hello, why margin bottom of child not increasing the height of parent:
<div class="my-container">
<div class="margin">
Hello World
</div>
<div class="margin">
Hello World
</div>
.my-container {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 300px;
background-color: #3873fe;
margin: auto;
}
.my-container .margin {
width: 100px;
margin: 0 auto 50px;
background-color: #00ff82;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
But if add border for parent, the height of parent will increased:
.my-container {
border:1px solid;
}
So I'd like to understand why this difference?