footer固定在页面底部的若干种方法_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:35:00
Original
1007 people have browsed it

1 <div class="header"><div class="main"></div></div>2 <div class="container"><div class="main"></div></div>3 <div class="footer"><div class="main"></div></div>
Copy after login

如果主体内容过短不足以支撑浏览器时,footer会上移,非常影响页面,算是一个大bug了,搜过很多种方法现整理一下footer固定在第的若干种方法,供以后参考。(欢迎大家积极补充。)

以上布局为给个人写页面常用。

注:.main{

width:1050px;

margin:0 auto;

height:auto;

}

1、这是刚刚使用过的css,可以达到效果,只是不论浏览器的大小如何footer均会在底,主体内容则以滚动条形式显示。

.footer{

position:fixed;

bottom:0;

left:0;

}

2.待整理。。。。。

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!