http://www.cssstickyfooter.com/
這個(gè)網(wǎng)頁(yè)即使內(nèi)容很少的情況下,它也始終在頁(yè)面的底部。否則頁(yè)面底部將留下大量空白。
footer位置自適應(yīng)
<div id="wrap">
<div id="main" class="clearfix">
<div id="content">
ccc
</div>
<div id="side">
sss
</div>
</div>
</div>
<div id="footer">
fff
</div>
html, body, #wrap {height: 100%;}
body > #wrap {height: auto; min-height: 100%;}
#main {padding-bottom: 150px;} /* 必須使用和footer相同的高度 */
#footer {position: relative;
margin-top: -150px; /* footer高度的負(fù)值 */
height: 150px;
background: #ddd;
clear: both;}
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
Tag標(biāo)簽: css,高度自適應(yīng)問(wèn)題,自適應(yīng)
如對(duì)本文有疑問(wèn),請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇
------分隔線----------------------------