Element UI 响应式布局实现一行5列布局

8 篇文章 0 订阅
6 篇文章 0 订阅

el-row el-col 实现一行5列

1、自定义类名

 <el-col :lg="{span:'4-8'}" :md="8" :sm="12" :xs="24">
 ....
 </el-col>

2、书写不同屏幕大小下,类的样式


  @media only screen and (min-width: 768px) {
    .el-col-sm-4-8 {
      width: 20%;
    }
    .el-col-sm-offset-4-8 {
      margin-left: 20%;
    }
    .el-col-sm-pull-4-8 {
      position: relative;
      right: 20%;
    }
    .el-col-sm-push-4-8 {
      position: relative;
      left: 20%;
    }
  }

  @media only screen and (min-width: 992px) {
    .el-col-md-4-8 {
      width: 20%;
    }
    .el-col-md-offset-4-8 {
      margin-left: 20%;
    }
    .el-col-md-pull-4-8 {
      position: relative;
      right: 20%;
    }
    .el-col-md-push-4-8 {
      position: relative;
      left: 20%;
    }
  }

  @media only screen and (min-width: 1200px) {
    .el-col-lg-4-8 {
      width: 20%;
    }
    .el-col-lg-offset-4-8 {
      margin-left: 20%;
    }
    .el-col-lg-pull-4-8 {
      position: relative;
      right: 20%;
    }
    .el-col-lg-push-4-8 {
      position: relative;
      left: 20%;
    }
  }

  @media only screen and (min-width: 1920px) {
    .el-col-xl-4-8 {
      width: 20%;
    }
    .el-col-xl-offset-4-8 {
      margin-left: 20%;
    }
    .el-col-xl-pull-4-8 {
      position: relative;
      right: 20%;
    }
    .el-col-xl-push-4-8 {
      position: relative;
      left: 20%;
    }
  }

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值