stick footer就是让footer元素固定在底部,1当内容不足满屏时,footer紧贴最底部。2,满屏需要下拉时,footer就在内容的底部
通常用于提示的页面,下面有个x的按钮,这个按钮就是footer,它是用于关闭这个弹窗的,内容少时处在底部,多时下拉才显示。保证你都看完了。
使用方法就是在所有的内容页设置height:100%;写文字的部分最小的高度min-height:100%;footer处在内容页之外
<div class=""content">
<div class="text">内容内容文字</div>
</div>
<div class="footer">关闭</div>
///注意千万不要写错了把content包住text和footer。content只有一个子元素text
下面设置样式了
.content{height:100%}
.text{min-height:100%;padding-bottom:50px;} //这个padding是给下面的按钮footer留的,是footer的高度。因为他自己已经设置了高度所以在这里要用padding
.footer{height:50px;margin-top:-50px;}