gpt4 book ai didi

html - 如何创建具有不同圆环颜色的有序列表

转载 作者:行者123 更新时间:2023-11-28 05:19:11 25 4
gpt4 key购买 nike

我正在使用有序列表显示结果。现在我想在数字中添加一个圆圈,颜色从绿色变为红色。使用是第一个结果是优先级,其他的次之。所以颜色渐变从绿色变为红色。

.listAddress li {
padding-top: 15px;
padding-bottom: 15px;
display: list-item;
padding: 10px 10px;
color: #252424;
font-size: 12px;
width: auto;
font-style: normal;
text-transform: uppercase;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
<ol class="listAddress">
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
</ol>

最佳答案

看看这是否有帮助。

jsFiddle

body { background: white; }
.listAddress {
padding-left: 0;
position: relative;
}
.listAddress:before {
content: "";
position: absolute;
z-index: -2;
left: 0;
top: 0;
bottom: 0;
width: 20px;
background: linear-gradient(to bottom, green, red);
}
.listAddress li {
counter-increment: step-counter;
list-style: none;
padding-bottom: 20px;
position: relative;
padding-left: 25px;
overflow: hidden;
}
.listAddress li:before {
content: counter(step-counter);
margin-right: 5px;
box-shadow: 0 0 0 100px white;
color: white;
border-radius: 50%;
position: absolute;
z-index: -1;
left: 0;
top: 0;
text-align: center;
width: 20px;
height: 20px;
}
<ol class="listAddress">
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
<li>365 W Northwest Hwy, Palatine, IL 60067, USA</li>
</ol>

关于html - 如何创建具有不同圆环颜色的有序列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41351197/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com