You use two different counters: one for li parents and one for li subtexts. Then, in each li subtopic, combine several counter() functions using each counter, for example:
ol { counter-reset: item; } ol ol { counter-reset: subitem; } li { display: block; } li:before { content: counter(item, decimal-leading-zero) ' '; counter-increment: item; } li li:before { content: counter(item, decimal-leading-zero) counter(subitem, lower-alpha) ' '; counter-increment: subitem; }
jsFiddle demo , tested in all browsers that support counters :before and CSS2.1, including IE8 +
Useful reading: W3C CSS2.1 generated content specification, Β§12.4.1 Nested counters and scope
source share