Home > Article > Web Front-end > Let the bottom of the page float and fix it_html/css_WEB-ITnose
??
1. Get the screen height,
2. Get the page height.
3. Determine the size between the two. When the page height is greater than the screen height, the floating background style is not added. Otherwise add it. Don't judge whether to scroll the screen.
Get the screen height $(window).height();$(document).height();
Floating to the bottom fabric:
.footer{
position:fixed;
width:100%;
display:block;
bottom:0;
}