1、问题
网页不满屏时,如何让footer固定在底部,网页满屏时,随高度走
2、解决
html {
position: relative;
min-height: 100%;
}
body {
padding-bottom: 80px;
}
.footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 80px;
}
3、总结
这是纯css方式解决问题,当然也还有js获取屏幕高度解决