我希望這個紅色的短劃線之間的第一和第二(和第二和第三)「李」平均位於此列表中,但它出現在它上面,而不是在左側。這樣做有可能嗎?這裏的例子:如何把這個短劃線元素之間的李的
http://codepen.io/anon/pen/ENzXao
這就是我試圖完成:http://sketchtoy.com/67757539
.main__headers--info ul li {
font-size: 20px;
list-style: none;
display: inline-block;
font-weight: bold;
}
.main__headers--info ul li:nth-child(2),
.main__headers--info ul li:nth-child(3) {
margin-left: 50px;
}
.main__headers--info ul li:nth-child(2)::before {
content: "";
display: block;
border: 1px solid red;
width: 50px;
}
<div class="main__headers--info">
<ul>
<li>lorem lorem</li>
<li>lorem ipsum</li>
<li>something</li>
</ul>
</div>
你想紅色短跑在第一和第二? –
紅色短劃線應出現在第二個「li」之前和第三個「li」之前,但不是第一個之前 – Smithy
然後只需修改'.main__headers - info ul li:nth-child(2):: before {'to '.main__headers - info ul li:nth-child(2):: before,.main__headers - info ul li:nth-child(3):: before {'? – junkfoodjunkie