问题:
我正在使用 jQuery 将页脚与页面底部对齐。它适用于 FF,但 IE、Chrome 和 Safari 将页脚向下推约 50-100 像素。
你自己看:
查看www.directsponsor.org的页脚以查看该问题的实时示例。
编码:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
matchHeight();
function matchHeight() {
var mainHeight = $("#wrapper").outerHeight() - $("#header").outerHeight() - $("#leader").outerHeight() - $("#footer").outerHeight() - parseInt($("#footer").css("margin-top")) - 1 - parseInt($("#main").css("padding-top"))- parseInt($("#main").css("padding-bottom"));
var mainReal = $("#main").outerHeight(true);
if ((mainHeight + 1 + parseInt($("#main").css("padding-top")) + parseInt($("#main").css("padding-bottom"))) > mainReal) {
$('#main').height(mainHeight);
}
}
$(window).resize(matchHeight);
});
</script>
我的问题:
是什么导致页脚下沉到页面底部以下?