带箭头的进度流程 css

本文介绍如何使用CSS技术创建带有箭头的进度流程图,无需依赖Vue.js。只需关注CSS样式,即可轻松复制应用到你的项目中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

html

<ul class="cssNav">
    <li v-for="(item,i) in list" :class="[num==i?'active':'']" @click="tab(i)">{{item}}</li>
</ul>

css

.cssNav {
        margin: 100px auto;
        background-color: #dedede;
        width:420px;
    }

    .cssNav li{
        padding:0 20px;
        line-height: 40px;
        background-color: #50abe4;
        display: inline-block;
        color:#fff;
        position: relative;
        margin-right: 4px;
    }
    .cssNav li:after{
        content:"";
        display: block;
        border-top:20px solid transparent;
        border-bottom:20px solid transparent;
        border-left:20px solid #50abe4;
        position: absolute;
        right:-20px;
        top:0;
        z-index: 10;
    }
    .cssNav li:before{
        content:"";
        display: block;
        border-top:20px solid transparent;
        border-bottom:20px solid transparent;
        border-left:20px solid #fff;
        position: absolute;
        left:0px;
        top:0;
    }

    .cssNav li:first-child{
        border-radius: 4px 0 0 4px;
        padding-left:25px;
    }
    .cssNav li:last-child,.cssNavEnd{
        border-radius: 0 4px 4px 0;
        padding-right: 25px;
    }
    .cssNav li:first-child:before{
        display: none;
    }
    .cssNav li:last-child:after,.cssNavEnd:after{
        display: none;
    }
    .cssNav li.active {  
        background-color: #ef72b6;  
    }  
    .cssNav li.active:after {  
        border-left-color: #ef72b6;  
    } 

js

// 需要引入vue.js 
 new Vue({
        el: '.cssNav',
        data: {
                num:0,
                list:['首页','测试文字','新闻也','地址页']
            },
        methods: {
            tab:function(i){
                this.num = i;
            }
        }   
    })

说明:如果不用vue.js来写,只需要把样式复制就可以了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值