To start with, I have looked up different ways to fix this issue on StackOverflow but none of the proposed answers have worked with me. I am using bootstrap 4.6.0, trying to set the footer at the bottom but the issue I am facing is that when resizing the screen the footer goes on top of the body content. Tried to use the fixed-bottom class. Also tried to set the body position to relative and give it a min-height of 100% then set the position of the footer to absolute but that did not work either I used ASP.NET MVC and I will share my full used code for your review.
.main-login-container {
padding-top:40px;
position:relative;
display: flex;
justify-content: center;
align-items: center;
min-height: 70%;
min-height: 70vh;
}
body {
height: 100%;
}
html * {
box-sizing: border-box !important;
}
html {
height: 100%;
box-sizing: border-box !important;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
.footer{
position: absolute;
bottom: 0;
background-color: #16a085;
width:100%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js"></script>
<div class="container body-content" >
<div class="containter">
<div class="form-group">
<label class="control-label">Email:</label>
<input class="form-control" type="email"/>
</div>
<div class="form-group">
<label class="control-label">Password:</label>
<input class="form-control" type="password" />
</div>
</div>
<footer class="footer">
<p style="text-align:center">My ASP.NET Application</p>
</footer>
</div>
How Can I make the footer stay at the bottom of the page even if a resize the browser? Also tried transform:translateX(80%) but did not work.