Recently I ran into a problem where I have created an ordered list with more than hundred list items. I have set list-style: decimal-leading-zero;
ol{
list-style: decimal-leading-zero;
}
<ol>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
</ol>
<p>...</p>
<ol start="96">
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
<li>Some item</li>
</ol>
Issue: Only first nine list items have leading zero.
Extpected: two leading zeros in first nine list items and one leading zero for 10th to 99th list items.
There is no
list-style
for three digit decimals.However, you can use pseudo-selectors and counters to achieve what you want here.
Refer code: