亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

  發(fā)布時(shí)間:2014-07-28 16:26:14   作者:佚名   我要評論
本節(jié)主要介紹了如何讓footer始終位于頁面的最底部不隨滾動(dòng)而滾動(dòng),此效果在網(wǎng)頁中非常實(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.千萬不能設(shè)置.container的高度為100%,否則將無法隨滾動(dòng)條的滾動(dòng)而滾動(dòng).

相關(guān)文章

最新評論