给html,body设置min-height不起作用
我在写页面的时候,遇到了当内容区页面不到一屏时,footer下面就会留白,给html,body设置min-height:100%;没起作用,直接设置height:100%;在页面超出一屏,出现滚动条的时候,footer就会显示在一屏处。以下是我的解决方案。
html{
height:100%;
}
body{
position:relative;
min-height:100%;
box-sizing:border-box;
padding-bottom:140px;
}
.footer{
position:absolute;
bottom:0;
left:0;
width:100%;
height:140px;
}