I have a nested ordered list.
<ol>
<li>first</li>
<li>second
<ol>
<li>second nested first element</li>
<li>second nested secondelement</li>
<li>second nested thirdelement</li>
</ol>
</li>
<li>third</li>
<li>fourth</li>
</ol>
Currently the nested elements start back from 1 again, e.g.
- first
- second
- second nested first element
- second nested second element
- second nested third element
- third
- fourth
What I want is for the second element to be numbered like this:
- first
-
second
2.1. second nested first element
2.2. second nested second element
2.3. second nested third element
- third
- fourth
Is there a way of doing this?
Here’s an example which works in all browsers. The pure CSS approach works in the real browsers (i.e. everything but IE6/7) and the jQuery code is to cover the unsupported. It’s in flavor of an SSCCE, you can just copy’n’paste’n’run it without changes.