嗨,我正在制作一个带有箭头作为分隔符的进度条,如下所示:
HTML
<ul>
<li>
step 1
<span class="arrow"></span>
</li>
<li>
step 2
<span class="arrow"></span>
</li>
<li>
step 3
</li>
</ul>
CSS
li{
float: left;
width: 25%;
background-color: #4a4a4a;
color: #fff;
text-align: center;
padding: 10px 0;
position: relative;
z-index: 100;
}
.arrow{
width: 0;
height: 0;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
border-left: 30px solid red;
display: block;
position: absolute;
right: -30px;
top: 0px;
z-index: 200;
}
演示:http: //jsfiddle.net/pleasedontbelong/kGmg5/
但箭头总是在li
元素后面。我错过了什么吗?是否可以在不更改 html 的情况下执行此操作?