HTML and lists are a new level for me, I'm trying to create a nested list in HTML with related numbers, and use an alphanumeric type in the third level.
body { padding-left: 100px; } ol { list-style-type: none; counter-reset: item; margin: 0; padding: 0; } ol>li { display: table; counter-increment: item; margin-bottom: 0.6em; } ol>li:before { content: counters(item, ".",decimal-leading-zero) ". "; display: table-cell; padding-right: 0.6em; } li ol>li { margin: 0; } li ol>li:before { content: counters(item, ".",decimal-leading-zero) " "; }
<ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> <li></li> <li> <ol> <li></li> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> </ol> </li> </ol>
The above is my code. The results are as follows:
01. 01.01 01.02 01.03 02. 03. 04. 04.01 04.02 04.02.01 04.02.02 04.02.03
But what I want is:
01. 01.01 01.02 01.03 02. 03. 04. 04.01 04.02 a. ← b. ← c. ← 04.03
Does anyone know how to solve this problem?
I have tried digital solutions and searched the web. This is how I arrived at the above solution. But I can't find a styling solution for the lowercase type of the third level.
The easiest way is to change your third level list items back to list items, hide the content and use a list style with lowercase letters:
Please check the working code below: