I am facing an issue with my non-fixed navbar and two-column layout when testing the responsiveness on a mobile screen size. I need Column A to fill the remaining viewport's height, while Column B should move under Column A without hardcoding any values like subtracting the navbar's height. I attempted using Flexbox to achieve this, but so far have been unsuccessful as both columns appear in the viewport instead. Currently, I am utilizing Bootstrap for the responsiveness of the layout.
Here is an illustration depicting my problem. Below is the code snippet that I have been working with:
.flex-container {
display: flex;
flex-direction: column;
}
#content {
flex-grow: 1;
}
#row {
flex-grow: 1; max-width: 100vw;
}
#col1 {
background-color: dimgrey;color: white;
}
#col2 {
background-color:darkslategrey;color: white
}
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>Web title</title>
</head>
<body>
<div class="vh-100 flex-container">
<nav class="navbar navbar-dark bg-dark">
<div class="container px-0">
<span class="navbar-brand mb-0 h1">Navbar title</span>
</div>
</nav>
<div id="content" class="container flex-container px-0">
<div id="row" class="row mx-0">
<div id="col1" class="col-sm px-0">
Column 1 content
</div>
<div id="col2" class="col-sm px-0">
Column 2 content
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="30405f404055421e5a4370011e01061e00">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>