footer ın sürekli sayfanın en altında kalmasını sağlamak istiyorum bunu nasıl yapabilirim yani 1280*1024 de de 1024*768 de de girsek hep altta olsun istiyorum.
Bunu iki yolla yapabilirsiniz;
1) CSS ile sticky footer
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* buradaki negatif değer de footer yüksekliğinde olmalı */
}
.footer, .push {
height: 142px; /* .push, .footer ile aynı yüksekliğe sahip olmalı */
}
2. jQuery ile sticky footer
*Footer yüksekliği olmalıdır kesinlikle.
<div id="footer">footer</div>
// Window load event used just in case window height is dependant upon images
$(window).bind("load", function() {
var footerHeight = 0,
footerTop = 0,
$footer = $("#footer");
positionFooter();
function positionFooter() {
footerHeight = $footer.height();
footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
if ( ($(document.body).height()+footerHeight) < $(window).height()) {
$footer.css({
position: "absolute"
})
} else {
$footer.css({
position: "static"
})
}
}
$(window)
.scroll(positionFooter)
.resize(positionFooter)
});