0
我試圖創建如下圖模擬此圖:如何使用僞元素
我可以畫圓,並使用下面的代碼片段直線。請幫我畫曲線和紅圈。我附上了圖片。這可能使用CSS僞元素嗎?
<ul>
{this.props.invoiceCounts.map((invoiceCount) => {
return (
<li key={invoiceCount.key} className="invoice-state">
<div>{invoiceCount.name}</div>
<div className={invoiceCount.className}> {invoiceCount.count} </div>
</li>
);
})}
</ul>
.invoice-state {
color: grey;
display: inline-block;
text-align: center;
}
.circle {
border-radius: 50%;
height: 40px;
text-align: center;
width: 40px;
margin: 0px 60px;
line-height: 40px;
}
li::before{
content: '';
position: absolute;
top: 81px;
width: 142px;
height: 1px;
background: grey;
z-index: -1;
}
li:last-child::before {
display:none;
}
.white-circle {
@extend .circle;
background-color: white;
border: 1px solid grey;
color: grey;
}
.grey-circle {
@extend .circle;
background-color: grey;
color: white;
}
.red-circle {
@extend .circle;
background-color: red;
color: white;
}
.green-circle {
@extend .circle;
background-color: green;
color: white;
}
哇。真棒。非常感謝。 –