I have set up 3 divs, one of which has a div within a div. Neither div has content. I am only sizing them and applying a background color.
div {
box-sizing: border-box;
display: inline-block;
width: 25%;
height: 250px;
margin: 30px auto 30px 6%;
background-color: darkgoldenrod;
border: 2px solid black;
}
.innerDiv {
background-color: lightgreen;
width: 25%;
height: 75%;
margin-top: 63px;
padding: 0;
}
<div>
<div class="innerDiv">
hello
</div>
</div>
<div></div>
<div></div>
I had to add a margin-top to bring it back up and even with the other divs.
Additionally, if I add any content to the inner div the whole set up is pulled even further down the page.
Why is this happening?