I'm using bootstrap 4.5 for my Django project. I want my footer to be:
1- at the bottom of the content if contents are larger than viewheight
2- at the bottom of the viewport if the contents are smaller than viewheight
exactly as this:
here is what I have tried so far based on SO answers to similar questions,
is base.html
:
<style>
#page-container {
position: relative;
}
#content-wrap {
padding-bottom: 2.5rem; /* Footer height */
}
#footer {
position: absolute;
bottom: 0 !important;
width: 100%;
}
</style>
<body style="position:relative;">
<div id="page-container">
<div id="content-wrap">
<!-- all other page content -->
{% include 'partials/_navbar.html' %}
<div >
{% block content %} {% endblock %}
</div>
</div>
{% include 'partials/_footer.html' %}
</div>
</body>
in _footer.html
<footer class="page-footer font-small blue-grey lighten-5 mt-auto" id="footer" >
....
</footer>
but the result is either the first image(left) or it gets sticky to the bottom of the page no matter how much tall contents get.