Home >Web Front-end >HTML Tutorial >Let the bottom of the page float and fix it_html/css_WEB-ITnose

Let the bottom of the page float and fix it_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:561635browse

??

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;

}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn