I'm trying to use flexbox to resize my middle div ("canvas") whenever I apply display: none; to any of the side divs.
Currently, it works for both the right and left divs but the bottom one doesn't work. When I add display:none to the bottom canvas doesn't resize to the rest of page.
Any ideas on how to make the bottom one work as well?
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body {
display: flex;
flex-direction: column;
}
.ribbon {
background: beige;
height: 10vh;
}
.outer-col {
display: flex;
flex-direction: column;
}
.inner-col {
display: flex;
flex-direction: row;
flex: 1 1 0;
}
.inner-row {
flex: 6;
}
.canvas {
background: skyblue;
min-height: 70vh;
}
.left {
/* display: none; */
background: beige;
flex: 1;
}
.right {
/* display: none; */
background: beige;
flex: 1;
}
.bottom {
/* display: none; */
background: beige;
height: 20vh;
}
.ribbon, .bottom, .canvas, .ribbon, .left, .right {
border-style: solid;
}
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<script src="https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js"></script>
<script src="./script.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="ribbon"></div>
<div class="outer-col">
<div class="inner-col">
<div class="left"></div>
<div class="inner-row">
<div class="canvas"></div>
<div class="bottom"></div>
</div>
<div class="right"></div>
</div>
</div>
</body>
</html>