css实现箭头流程,用CSS实现带箭头的流程进度条

be45eb6c5fd66d11a803e0291ef8bfd0.png

本文介绍的是利用纯CSS的带箭头流程进度条,兼容到IE8,需要的朋友们下面来一起学习学习。

首先写出一个基本的样式。

1cca384875bdeadede6ea7120364fa59.png

.cssNav li{

padding: 0px 20px;

line-height: 40px;

background: #50abe4;

display: inline-block;

color: #fff;

position: relative;

}

接下来使用 :after 伪类画出一个三角形,定位到右边,如下:

06c2166085a62528bd38bedfc940b822.png

.cssNav li:after{

content: '';

display: block;

border-top: 20px solid red;

border-bottom: 20px solid red;

border-left: 20px solid blue;

position: absolute;

rightright: -20px;

top: 0;

}

然后将after的颜色修改下,基本的雏形已经看到了。

36ce8670df5170a9da0e5bd4a63d98b4.png

.cssNav li:after{

content: '';

display: block;

border-top: 20px solid transparent;

border-bottom: 20px solid transparent;

border-left: 20px solid #50abe4;

position: absolute;

rightright: -20px;

top: 0;

z-index: 10;

}

继续使用 :before 伪类来画出左边的三角形。如下:

d4ef4dac9f490cdf7c9b15b5e7317a79.png

.cssNav li:before{

content: '';

display: block;

border-top: 20px solid red;

border-bottom: 20px solid red;

border-left: 20px solid blue;

position: absolute;

left: 0px;

top: 0;

}

然后修改下before的颜色,并复制多个模块看看。

09a54378949d0d1b25e58b1cacb51b30.png

最后把开头和结尾的稍微修饰一下。

b653a6e9d547f8ebe2fe1d9f43bb2988.png

.cssNav li:first-child{

border-radius: 4px 0 0 4px;

padding-left: 25px;

}

.cssNav li:last-child,.cssNavEnd{

border-radius: 0px 4px 4px 0px;

padding-right: 25px;

}

.cssNav li:first-child:before{

display: none;

}

.cssNav li:last-child:after,.cssNavEnd:after{

display: none;

}

加上选中状态,大功告成。

97bc691105a3ee0c99a8a8d2ab1b0914.png

.cssNav li.active {

background-color: #ef72b6;

}

.cssNav li.active:after {

border-left-color: #ef72b6;

}

更多用CSS实现带箭头的流程进度条相关文章请关注PHP中文网!

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值