
html:
<div class="wrapper>
<div class="content">主体内容</div>
</div>123
css:
html,body{
height:100%
}
.wrapper{
min-height:100%//使内容高度和body高度一样
margin-bottom:-70px向上缩减70px,使footer在可视范围
}
.content{
margin-bottom:130px//控制主体内容和底部高度之间距离
}
.footer{
这种应该是fixed效果(设置某一模块固定在浏览器底部,页面滚动的时候也是),如果是我说的效果可以通过css设置:position: fixed
bottom:0
left:0
width:100%
这里要注意,设置fixed的元素要记得设置宽度。如果要考虑低级的ie浏览器,就要加上css表达式实现,因为ie6不支持fixed属性。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)