sticky-footer是css中的一个经典问题:
当页面内容超出屏幕,页脚模块会像正常页面一样,被推到内容下方,需要拖动滚动条才能看到。
而当页面内容小于屏幕高度,页脚模块会固定在屏幕底部,就像是底边距为零的固定定位。
html:
<div class="detailWrapper" v-show="detailShow"><div class="sticky-box clearfix"><div class="sticky-content">内容</div></div><div class="sticky-footer"><span class="icon-close" @click="showDetail"></span></div></div>
css:
.detailWrapperposition fixedz-index: 1top 0left 0width 100%height 100%background rgba(7,7,27,0.8)overflow auto.sticky-boxwidth 100%min-height 100%.sticky-contentmargin-top 64pxpadding-bottom 64px.sticky-footermargin -64px auto 0 autowidth 32pxheight 32pxline-height 32pxfont-size 32pxcolor rgba(255,255,255,0.5)cursor pointer
相关介绍文章:
https://www.cnblogs.com/wisewrong/p/6525696.html
https://www.w3cplus.com/css3/css-secrets/sticky-footers.html