我尝试显示从1到7的有序列表。
<ol>
<li>item 1</li>
<li>item 2
<ol>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
</ol>
</li>
<li>item 6</li>
<li>item 7</li>
</ol>
预期:
答案 0 :(得分:0)
是的,@ Rajibkarmaker,是要先重置第一个ol,然后再对每个li反向递增!
ol.example{counter-reset: section;}
ol.example,ol.example ol {list-style:none}
ol.example li::before {counter-increment: section; content: counter(section);}