I'm learning Bootstrap and I'm trying to figure out how to automatically adjust a rows height given this conditions:
- There are 3 rows within a container-fluid
- row1 must adjust to the height of its content
- row3 must adjust to the height of its content and be at the bottom of the viewport
- row2 should adjust its height to the space between row1 and row3 to fill the container-fluid
html, body, .container-fluid {
height: 100%;
background: lightyellow;
}
.col {
border: solid 1px #6c757d;
}
.content-1 {
height: 50px;
background-color: lightcoral;
}
.content-2 {
height: 200px;
background-color: lightgreen;
}
.content-3 {
height: 25px;
background-color: lightblue;
}
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="content-1">
ROW 1 -> Height of its content
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="content-2">
ROW 2 -> Height between row1 and row3 automatically adjusted
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="content-3">
ROW 3 -> Height of its content
</div>
</div>
</div>
</div>
JSFiddle demo
What would be the best approach to do so?. Thank you in advance!