Push footer to bottom when page is not full

前端 未结 5 1886
名媛妹妹
名媛妹妹 2021-02-13 18:58

I\'m developing a mobile web app. This is the main structure from top to bottom: header div, menu div, content div, footer div. The header, menu and footer are constant and page

5条回答
  •  渐次进展
    2021-02-13 19:49

        function autoHeight() {
            var h = $(document).height() - $('body').height();
            if (h > 0) {
                $('#footer').css({
                    marginTop: h
                });
            }
        }
        $(window).on('load', autoHeight);
    

提交回复
热议问题