3
I have done several applications and always used the method below to regulate the height of footer
. Always using Bootstrap.
HTML
<div id="footer">
<div class="navbar navbar-fixed-bottom">
<div id="rodape">Hi-Nutrition 2014</div>
</div>
</div>
CSS
#footer .navbar{
position: absolute !important;
}
#rodape{
text-align:center;
background:#a3a3a3;
color:white;
bottom:0;
position:absolute;
width:100%;
margin-bottom:0;
}
However, this time it’s not working. How could I be proceeding to keep my footer at the bottom of the page?
Maybe the problem is that in this project I am working with the shipment of a PartialView
via AJAX.
SCRIPT
function Open(url) {
Carregar();
url = '@Url.Content("~/")' + url;
$.ajax({
url: url,
type: 'GET',
success: function (response) {
$('#corpoConteudo').html(response);
$('#loader').remove();
},
error: function () {
alert('Ocorreu um erro!');
$('#loader').remove();
}
});
}
function Carregar() {
$('#corpoConteudo').append('<div id="loader"></div>');
}
This script loads the PartialView
into the <div id="corpoConteudo"></div>
and after that element, I’m calling my footer.
<div class="container">
<div id="corpoConteudo"></div>
</div>
</div>
<div id="footer">
Hi-Nutrition 2014
</div>
I mean, I think because I only carry a piece of code, say, man, container
with position:relative
does not push the baseboard down.
Some solution?
Thank you so much for the answer. I took a test outside of my project and it really worked. However, when applying in my scope, I had problems for the reasons I added in my post.
– Rafael Barbosa
If the footer is not being pushed, are the styles below the AJAX request? Inline for example or just loading a part of the styles?
– Marcos Vinicius