Here is my code:
The divs reappear when display: block;
is uncommented.
Please help explain why this is happening.
I thought they would always take up space since they have their height and width specified. Please explain why this is not the case.
#box-container {
height: 500px;
}
#box-1 {
background-color: dodgerblue;
width: 50%;
height: 50%;
display: inline;
/* display: block; */
}
#box-2 {
background-color: orangered;
width: 50%;
height: 50%;
display: inline;
/* display: block; */
}
<div id="box-container">
<div id="box-1"></div>
<div id="box-2"></div>
</div>