I am trying to design a webpage using Bootstrap 4 that consists of a header, footer, and main content. The main content should occupy the space below the header, and the footer should be positioned below the main content.
I attempted to achieve this by setting the height of the main content to 100vh, which partially worked. However, when I inserted an image, it started overlapping the footer. What could be the issue here? Why is the image not resizing properly?
#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>