我目前擁有的集裝箱下面的箭頭所示,此琴:https://jsfiddle.net/xo9vwks1/如何使CSS箭頭與容器的寬度相同?
HTML:
<ul class="arrows">
<li><div>sadf sdfsdsdf</div></li>
<li><div>sdsa sdss sdsd s </div></li>
<li><div>sdfsdf sad assdssds s sdsdds sn</div></li>
<li><div>sdsd sadfsdf asdf sadfon</div></li>
<li><div>sdf sdfsdf sss ssdss ss s asd sa gsdsdf</div></li>
</ul>
CSS:
ul.arrows li {
background-color: #ddd !important;
display: block;
margin-bottom: 40px !important;
padding: 0 10px !important;
text-align: center;
list-style: none;
max-width: 400px;
}
ul.arrows li div::after {
border-color: #ddd transparent transparent;
border-style: solid;
border-width: 30px;
content: " ";
height: 0;
position: absolute;
right: 0;
left: 50%;
top: 100%;
width: 0;
z-index: 10;
margin-left: -30px;
}
ul.arrows li:last-child div::after {
border-width: 0;
}
ul.arrows li div {
display: inline-block;
line-height: normal;
padding: 15px 0;
position: relative;
}
我想有箭頭一路從延長從左到右,以便它們等於容器的寬度,如下圖所示。箭頭也必須有響應。我無法解決這個問題。我該怎麼做呢?