[Front-end technical points you can't miss - custom step arrow progress]

How to implement step arrows with css

Look at the picture first:
sample image

Htnl code: active is the selected style

 <!-- 步骤条 -->
    <ul class="Steps clearfix">
         <li class="active"><span>1</span>选择场次</li>
        <li class="active"><span>2</span>资料填写</li>
         <li class="active"><span>3</span>报名缴费</li>
         <li class=""><span>4</span>报名成功</li>
    </ul>

css code: CV Dafa is over

//  步骤条
 .Steps {
    
    
    width: 713px;
    margin: 0 auto;
  }
   .Steps li {
    
    
    width: 165px;
    padding: 0px 0px 0 40px;
    line-height: 60px;
    background: #EEEEEE;
    display: inline-block;
    color: #D4D4D4;
    position: relative;
    float: left;
    font-size: 12px;
    margin-right: 7px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
   }
   .Steps li span{
    
    
    width: 35px;
    height: 35px;
    background: #FFFFFF;
    border-radius: 26px 26px 26px 26px;
    color: #D4D4D4;
    text-align: center;
    line-height: 35px;
    font-weight: 400;
    margin-right: 15px;
   }
   .Steps li:after {
    
    
    content: '';
    display: block;
    border-top: 30px solid #EEEEEE;
    border-bottom: 30px solid #EEEEEE;
    border-left: 30px solid #fff;
    position: absolute;
    right: -30px;
    top: 0;
   }
   .Steps li:after {
    
    
    content: '';
    display: block;
    border-top: 30px solid transparent;
    border-bottom: 30px solid transparent;
    border-left: 30px solid #EEEEEE;
    position: absolute;
    right: -30px;
    top: 0;
    z-index: 10;
   }
   .Steps li:before {
    
    
    content: '';
    display: block;
    border-top: 30px solid #EEEEEE;
    border-bottom: 30px solid #EEEEEE;
    border-left: 30px solid #fff;
    position: absolute;
    left: 0px;
    top: 0;
   }
   .Steps li:first-child {
    
    
    padding-left: 25px;
   }
   .Steps li:last-child {
    
    
    margin-right: -30px;
   }
   .Steps li:first-child:before {
    
    
    display: none;
   }
   .Steps li.active {
    
    
    background-color: #407EFD;
    color: #fff;
   }
   .Steps li.active span{
    
    
    color: #407EFD;
   }
   .Steps li.active:after {
    
    
    border-left-color: #407EFD;
   }
   .Steps li.active:before {
    
    
    border-top-color: #407EFD;
    border-bottom-color: #407EFD;
   }

Guess you like

Origin blog.csdn.net/qq_44749901/article/details/125928850