欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

讓footer始終位于頁(yè)面的最底部不隨滾動(dòng)而滾動(dòng)

  發(fā)布時(shí)間:2014-07-28 16:26:14   作者:佚名   我要評(píng)論
本節(jié)主要介紹了如何讓footer始終位于頁(yè)面的最底部不隨滾動(dòng)而滾動(dòng),此效果在網(wǎng)頁(yè)中非常實(shí)用,建議大家好好學(xué)習(xí)哦
html代碼:

復(fù)制代碼
代碼如下:

<div class="container">
<div cass="header"></div>
<div class="body"></div>
<div class="footer"></div>
</div>

第一種情況:footer隨著滾動(dòng)條的滾動(dòng)而滾動(dòng)

復(fù)制代碼
代碼如下:

.container{position:relative;width:100%;min-height:100%;}
.body{padding-bottom:50px;}
.footer{height:50px;position:absolute;bottom:0px;left:0px;}

第二種情況:footer始終在其底部固定

復(fù)制代碼
代碼如下:

.container{position:relative;width:100%;min-height:100%;}
.body{padding-bottom:50px;}
.footer{height:50px;position:fixed;bottom:0px;left:0px;}

注意:

1.千萬(wàn)不能設(shè)置.container的高度為100%,否則將無(wú)法隨滾動(dòng)條的滾動(dòng)而滾動(dòng).

相關(guān)文章

最新評(píng)論