I am trying to create a page using Bootstrap 4 that has a header, footer and main content. The main content should fill the space below the header and the footer should be below this.
I have tried to do this by setting 100vh height on the main content, this works but when I insert an image it is overlapping the footer. Where am I going wrong? Why is the image not resizing?
#content-header {
background: red;
color: white;
}
#content-main {
background: blue;
color: white;
height: 100vh;
}
#content-header {
background: red;
color: white;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<div id="app" class="h-100">
<div id="content" class="d-flex flex-column">
<nav id="content-header" class="p-4">
<div class="navContent d-flex justify-content-between">
Navbar
</div>
</nav>
<main id="content-main" class="flex-grow-1 p-5">
Main Content
<img class="img-fluid" src="https://placeimg.com/1000/1000/any">
</main>
<div id="footer" class="p-4">
Footer Content
</div>
</div>
</div>