In my project, I have many routes that each have different page heights. I am trying to place my footer at the bottom of the page when the content doesn't fit the viewport or when it does. I have trying making multiple wrapping divs and looked at many different solutions, however they are all either wrong or deprecated. The closest I have gotten was to statically place the footer at the bottom of the page. However, on some pages that don't have much content, you would still have to scroll to see the footer. How would I go about dynamically placing the footer at the bottom of my content?
Here is how I structured my content:
<body>
<div id="app">
<script type="module" src="/src/main.js"></script>
</div>
</body>
<footer class="footer">
<h5>Footer</h5>
<p>footer goes here</p>
</footer>
Here is my CSS:
html, body{
min-height: 100vh;
margin: 0;
display: flex;
flex-direction: column;
flex-grow: 1;
}
.footer{
display: flex;
flex-direction: column;
background-color: gray;
color: black;
text-align: left;
width: 100%;
margin-top: calc(75% + 60px);
}