美文网首页
h5页按钮组固定在底部

h5页按钮组固定在底部

作者: 前端雨 | 来源:发表于2021-08-31 16:08 被阅读0次

h5页固定在底部的按钮

  1. 问题
  • 单独使用fixed布局,会被键盘顶上去
  • 单独使用flex布局,在上划页面会被滑动脱离固定底部
  1. 方案
  • flex布局+fixed布局解决


    如图所示

    <div class="wrap">
        <div class="content">
        </div>

        <div class="footer>
        </div>
    </div>

    .wrap{
        display:flex;
        flex-direction:column;
        height:100%;
    }
    .footer{
        height:1rem;
        width: 100%;
        position: fixed;
        bottom:0;
        left:0;
    }

    .content{
        overflow-y:auto ;
        flex-shrink: 1;
        flex-grow: 1;
    }

相关文章

网友评论

      本文标题:h5页按钮组固定在底部

      本文链接:https://www.haomeiwen.com/subject/hepziltx.html