
原生 css 如何制作自增长的有序列表?
为了实现自动递增的列表编号,可以使用css 中的content 计数器:
.list {
counter-reset: index;
}
.item::before {
content: counter(index);
counter-increment: index;
display: inline-block;
width: 20px;
height: 20px;
background-color: red;
color: #ffffff;
text-align: center;
border-radius: 100%;
}ADHASKJXNASCSDLVL
这种方法允许你自定义列表编号的外观,而无需使用负担较重的框架或插件。










