H5 页面布局 - 滚动条限制

描述:当一个H5页面有头部与尾部的时候,在滑动页面的时候,滚动条会盖在上面,覆盖页面上的所有元素,不大美观,如何做到跟真机一样的效果,直接在指定区域呢?如下图所示进度条区域:


在这里插入图片描述


<template>
  <div class="Index">
    <header>标题</header>
    <section class="content">
      <router-link to="/index2">
        <button>下一步</button>
      </router-link>
      <div v-for="v in 200" :key="v">Test {{v}}</div>
    </section>
    <footer class="footer">
      <div>提交</div>
    </footer>
  </div>
</template>
<style lang="less" scoped>
.Index {
  display: block;
  position: relative;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  bottom: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: auto;
  left: 0;
  right: 0;
  margin: 0 auto;

  header {
    height: 50px;
    display: flex;
    border-bottom: 1px solid whitesmoke;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    line-height: 50px;
    display: block;
    color: #000000;
  }
  .content {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  footer {
    display: block;
    text-align: center;
    border-top: 1px solid whitesmoke;
    padding: 7px 0;
    div {
      width: 90%;
      border-radius: 50px;
      background: green;
      margin: 0 auto;
      height: 40px;
      line-height: 40px;
      color: rgba(255, 255, 255, 1);
      background-color: rgba(57, 122, 255, 1);
      box-shadow: 0px 2px 7px 0px rgba(255, 255, 255, 1);
    }
  }
}
</style>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rkatsiteli

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值