纯css 实现footer sticker

但愿footer一直在页面底部css

csshtml

html, body, #sticker {height: 100%;}
body > #sticker {height: auto; min-height: 100%;}
#stickerCon {padding-bottom: 40px;} 
#footer {margin-top:-40px; height: 40px; width: 100%; text-align: center;
line-height: 40px; color: #ABA498; font-size: 12px; background: #fafafa; 
border-top:1px solid #E7E7E7;}

htmlcode

<div id="sticker">
    <div id="stickerCon"></div>
</div>
<div id="footer">footer</div>

这样作的目的:当content的内容不可以撑起一个页面,底部信息会出如今页面某一位置,好比中部等,防止footer靠上。htm

相关文章
相关标签/搜索