前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >H5 页面布局 - 滚动条限制

H5 页面布局 - 滚动条限制

作者头像
White feathe
发布2021-12-08 15:30:59
8870
发布2021-12-08 15:30:59
举报
文章被收录于专栏:White feathe 的博客

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


在这里插入图片描述
在这里插入图片描述

代码语言:javascript
复制
<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>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/08/14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档