css布局,上下两部分。下面类似于浮动到上部分。margin-top:-40px;

1,移动端布局,出现滚动条。

​ 实现思路:整个盒子100%,上面的盒子固定高;下面盒子内容自动撑开,margin-top:-50px; 同时给下面的盒子添加子盒子来布局,如果子盒子中的内容超过这个屏幕的高度,就会自动出现滚动条;

<template>
  <div class="content">
    <div class="title"></div>
    <div class="main">
      <div class="order_group">
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>111</span><br>
        <span>112222</span><br>
        <span>112222</span><br>
        <span>112222</span><br>
        <span>112222</span><br>
        <span>112222</span><br>
        <span>112222</span><br>
      </div>
    </div>
  </div>
</template>
<style>
  #app{
    width: 100%;
    height: 100%;
  }
</style>
<style lang="scss" scoped>
.content {
  width: 100%;
  height: 100%;
  background: #cccccc;
  .title {
    width: 100%;
    height: 150px;
    background: red;
  }
  .main{
    margin-top: -50px;
    .order_group{
      margin: 0 15px 15px 15px;
      background: #fff;
    }
  }
}
</style>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值