• HTML+CSS-->箭头流程进度条(两种方法)


    1、伪类

    2、移动

     

     html

     <!-- 1、用伪类画箭头部分 -->
            <div class="test"></div>
            <div class="test"></div>
            <div class="test"></div>
            <br/><br/><br/>
        <!--2、红箭头是单独的盒子,通过移动显示出箭头 -->
        <div id="progress">
            <div class="bg-red">
            </div>
            <div class="bg-red">
                <div class="triangle-box">
                    <div class="triangle bg-red"></div>
                </div>
            </div>
            <div class="bg-red">
                <div class="triangle-box">
                    <div class="triangle bg-red"></div>
                </div>
            </div>
            <div class="bg-gray">
                <div class="triangle-box">
                    <div class="triangle bg-red"></div>
                </div>
            </div>
        </div>

    CSS

    /* 1、使用伪类画箭头部分 */
    .test{
        float: left;
        margin: 0  2px 0 ;
         100px;
        height: 40px;
        background-color: #DD2727;
        position: relative;
    }
    .test:after{
        content: '';  
        display: block;  
        border-top: 20px solid transparent;  
        border-bottom: 20px solid transparent;  
        border-left: 20px solid #DD2727; 
        position: absolute;
        top: 0;
        left: 100px;
        z-index: 10;
    }
    .test:before{
        content: '';  
        display: block;  
        border-top: 20px solid transparent;  
        border-bottom: 20px solid transparent;  
        border-left: 20px solid white; 

    }

    /* 2、红箭头是单独的盒子,通过移动显示出箭头 */
    #progress{
        display: flex;
        justify-content: start;
    }
    #progress>div{
         100px;
        height: 34px;
        line-height: 35px;
        color: white;
        position: relative;
        text-align: center;
    }
    /* 三角形 */
    .triangle-box{
        display: inline-block;
         20px;
        height: 34px;
        overflow: hidden;
        position: absolute;
        left: 0;
    }
    .triangle{
        transform:rotate(45deg);
        transform-origin: left top;
        position: absolute;
        top: -3px;
        left: -1px;
         25px;
        height: 25px;
        border: 2px solid white;
    }
    /* 红色、灰色背景 */
    .bg-red{
        background-color: #DD2727;
    }
    .bg-gray{
        background-color: #CCCCCC;
    }


  • 相关阅读:
    Codeforces1070 2018-2019 ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred)总结
    Codeforces 633H Fibonacci-ish II【线段树】
    一些Fibonacci数列的神奇性质【数学】
    Codeforces 620E New Year Tree【线段树傻逼题】
    Codeforces 828C String Reconstruction【并查集巧妙运用】
    Codeforces 559C Gerald and Giant Chess【组合数学】【DP】
    Codeforces 311B Cats Transport【斜率优化DP】
    BZOJ2933 [Poi1999]地图【区间DP】
    BZOJ3688 折线统计【树状数组优化DP】
    BZOJ2131 免费的馅饼【线段树优化DP】
  • 原文地址:https://www.cnblogs.com/yi-miao-2333/p/14487771.html
Copyright © 2020-2023  润新知