css3画步骤条 矩形向右箭头

要实现的效果如图:

代码如下:

<template>
  <div class="page">
    <div class="title">我要开店</div>
    <p style="padding-top:25px;">一个身份只能开一家店;开店后店铺无法注销;申请到正式开通预计需1-3个工作日。了解更多请看
      <el-button type="text">开店规则必看</el-button>
    </p>
    <div class="steps">
      <div
        v-for="(item,index) in process"
        class="step step_r"
        :class="{active:($route.query.step || 1) == (index+1)}"
      >
        <div style="position:absolute;right:-42px;height:80px;width:80px;overflow:hidden;">
          <div class="rotateBox"></div>
        </div>
        <div class="step_b">
          <div class="num">{{index+1}}</div>
          <div class="info">
            <p class="up">{{item.step}}</p>
            <p class="down">{{item.desc}}</p>
          </div>
        </div>
      </div>
    </div>
    <div>
    </div>
  </div>
</template>

 

CSS代码如下:

<style lang='scss' scoped>
.page {
  height: 260px;
  width: 100%;
  .title {
    width: 105px;
    height: 37px;
    font-size: 26px;
    font-family: PingFangSC-Medium;
    font-weight: 500;
    color: #333333;
    line-height: 37px;
    padding: 34px 0;
  }
  .steps {
    width: 100%;
    display: flex;
    margin-top: 17px;
    zoom: 1;
  }
  .steps::after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    font-size: 0;
    height: 0;
    line-height: 0;
  }
  .step {
    flex: 1;
    width: 320px;
    height: 80px;
    background: #E4F0FD;
    position: relative;
    .step_b {
      width: 230px;
      margin: 7px auto 7px 40px;
      display: flex;
      .num {
        width: 20px;
        height: 67px;
        font-size: 48px;
        font-family: PingFangSC-Regular;
        font-weight: 400;
        color: #666666;
        line-height: 67px;
        margin-right: 20px;
      }
      .info {
        height: 37px;
        margin-top: 15px;
        .up {
          width: 84px;
          height: 20px;
          font-size: 14px;
          font-family: PingFangSC-Regular;
          font-weight: 400;
          color: #666666;
          line-height: 20px;
        }
        .down {
          height: 17px;
          font-size: 12px;
          font-family: PingFangSC-Regular;
          font-weight: 400;
          color: #888888;
          line-height: 17px;
        }
      }
    }
  }
  //旋转的小方形盒子
  .rotateBox {
    content: "";
    border:10px solid #fff;
    border-bottom: none;
    border-left: none;
    background-color: #E4F0FD;
    height: 68px;
    width: 68px;
    position: absolute;
    display: block;
    top: 6px;
    right: 15px;
    z-index: 10;
    transform:rotate(45deg);
  }
  .step_l {
    margin-right: 0;
  }
  .active {
    background: #75B0DF !important;
    .num {
      color: #FFFFFF !important;
    }
    .up {
      color: #FFFFFF !important;
    }
    .down {
      color: #0E58AF !important;
    }
  }
  //被激活的步骤条的样式
  .active .rotateBox {
    background-color: #75B0DF;
    content: "";
    border: 10px solid #fff;
    border-bottom: none;
    border-left: none;
    height: 68px;
    width: 68px;
    position: absolute;
    display: block;
    top: 6px;
    right: 15px;
    z-index: 10;
    transform:rotate(45deg);
    // -ms-transform:rotate(45deg);  /* IE 9 */
    // -moz-transform:rotate(45deg);   /* Firefox */
    // -webkit-transform:rotate(45deg); /* Safari 和 Chrome */
    // -o-transform:rotate(45deg);   /* Opera */
  }
  //最后一步取消向右箭头
  .step:last-child .rotateBox{
    content: "";
    border: none;
    height: 0;
    width: 0;
    z-index: 11;
  }
}
</style>

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值