I'm struggling to find a way in CSS that I have ...
https://jsfiddle.net/Lh0kLvj7/
ol.content {
counter-reset: item 1;
list-style: none;
}
li.content:before {
counter-increment: item;
content: counter(item)". ";
}
ol.content ol.content li.content:before {
counter-increment: item;
content: counters(item, ".") " ";
}
<p><span style="font-size: 24px;">On this page:</span></p>
<ol class="content">
<li class="content"><a href="#">section TWO</a>
<ol class="content">
<li class="content"><a href="#section2-1">TWO point *ONE* (not 2.2!)</a></li>
<li class="content"><a href="#section2-2">TWO point *TWO*</a></li>
<li class="content"><a href="#section2-3">TWO point *THREE*</a></li>
<li class="content"><a href="#section2-4">TWO point *FOUR*</a>
<ol class="content">
<li class="content">TWO point *FOUR* point *ONE* (not 2.5.2!)</li>
<li class="content">Title...</li>
<li class="content">Title...</li>
<li class="content">Title...</li>
<li class="content">Title...</li>
</ol>
</li>
<li class="content"><a href="#section2-5">TWO point *FIVE*</a></li>
</ol>
</li>
</ol>
... first start the parent sequence of the counter with a number that is not one (that is, section 2 in the script above), but the nested lists actually begin with .1. I'm not very good at CSS, so this might be something simple that I am missing. In the above script, you will see that the HTML is not displayed correctly ...
2.
2. 2
2.3
2,4
2,5
2.5. 2
when i need ...
2.
2. 1
2.3
2,4
2. 4.1
/, , counter- reset: item 1;, counter- reset: item 2;, counter - reset: item 4; .. -, , reset, 1.