CSS 实现左滑删除

    .list::-webkit-scrollbar {
      display: none;
    }

    .list {
      display: flex;
      overflow-y: hidden;
      scroll-snap-type:x mandatory;
    }

    .content {
      flex: 0 0 100vw;
      background-color: #fff;
      position: relative;
      scroll-snap-align: start;
    }

    .space {
      flex: 0 0 4rem;
      scroll-snap-align: end;
    }

    .button {
      text-align: center;
      background-color: aquamarine;
      color: #fff;
      width: 4rem;
      position: absolute;
      right: 0;
    }

  <div class="list">
    <p class="button" data-type="danger">删除</p>
    <p href="javascript:" class="content">我是列表,试试左滑我</p>
    <p class="space"></p>
  </div>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容