Home  >  Article  >  Web Front-end  >  footer固定在页面底部的若干种方法_html/css_WEB-ITnose

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

WBOY
WBOYOriginal
2016-06-24 11:35:00984browse

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>

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

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

注:.main{

width:1050px;

margin:0 auto;

height:auto;

}

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

.footer{

position:fixed;

bottom:0;

left:0;

}

2.待整理。。。。。

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