It asked hundred of times, and will be asked thousands again. There are tones of answers some of them stick the div in bottom of screen, not the page, some them needs you change your html and css. But I found this solution really easy to use. It uses JQuery and works even in IE6;
Assume that your footer div has footer ID.
Put this in bottom of page:
<script type="text/javascript">
<!--
$(document).ready(function () {
var docHeight = $(window).height();
var footerHeight = $('#footer').height();
var footerTop = $('#footer').position().top + footerHeight;
if (footerTop < docHeight) {
$('#footer').css('margin-top', 10 + (docHeight - footerTop) + 'px');
}
});
// -->
</script>
It just works.source: http://blog.gaijindesign.com/jquery-stick-your-div-to-the-bottom-of-a-short-page-v2-0/
هیچ نظری موجود نیست:
ارسال یک نظر