I have 3 divs, One on the left side, one in the middle, and one on the right side. The middle contains some information. The height of it is not fixed. The divs on both sides have the same height as the middle's. I want them to fill the remaining space (the vertical space instead of horizontal space). I've tried several ways --- position, flex, float --- all of them don't work as I thought. the HTML:
<div id="bigbox">
<div class="left"></div>
<div class="mid"></div>
<div class="right"></div>
</div>
the CSS:
#bigbox {
display: flex;
}
.left {
width: 10%;
background-color: red;
height: 100%;
}
.mid {
width: 80%;
background-color: green;
height: 500px;
}
.right {
width: 10%;
background-color: blue;
height: 100%;
}
The effect I want is as the following picture. enter image description here