我有一个<ul>
-list 有两个不同的计数器:
ul.numbered {
counter-reset: alphaCounter, numberCounter;
}
ul.numbered li.numbered,
ul.numbered li.lettered {
padding-left: 1.8em;
}
ul.numbered li.numbered:before {
position: absolute;
top: 0;
left: 0;
counter-increment: numberCounter;
content: counter(numberCounter, decimal) ". ";
}
ul.numbered li.lettered:before {
position: absolute;
top: 0;
left: 0;
counter-increment: alphaCounter;
content: counter(alphaCounter, upper-alpha) ". ";
}
这个列表li.lettered
用 A.、B. 等正确计算 -items。但li.numbered
-items 总是以“1.”开头。如果我将计数器重置的顺序切换为counter-reset: numberCounter, alphaCounter;
,数字会正确计数,并且字母始终以“A.”开头。
根据我阅读的内容,我正确设置了列表,但显然不是。对此有什么帮助吗?