footer 贴在底部的布局实现代码

网站建设 2023-01-28 21:37www.1681989.com免费网站
footer位置自适应

复制代码
代码如下:

<div id="wrap">
<div id="ma" class="clearfix">
<div id="content">
c
</div>
<div id="side">
sss
</div>
</div>
</div>
<div id="footer">
fff
</div>


复制代码
代码如下:

html, body, #wrap {height: 100%;}
body > #wrap {height: auto; m-height: 100%;}
#ma {paddg-bottom: 150px;} / 必须使用和footer相同的高度 /
#footer {position: relative;
marg-: -150px; / footer高度的负值 /
height: 150px;
background: #ddd;
clear: both;}
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: le-block;}
/ Hides from IE-mac \/
html .clearfix {height: 1%;}
.clearfix {display: block;}
/ End hide from IE-mac /

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by