I have an ordered list with some li
tags in it. I want the The li
tags with .sub-item
class to be nested li tags. Is there a way I can reset numbering for the li tags having class? The list is as below:
<ol>
<li>One</li>
<li>Two</li>
<li>THree</li>
<li class="sub-item">Sub three 1</li>
<li class="sub-item">Sub three 2</li>
<li>Four</li>
</ol>
Currently I get which makes sense:
1 One
2 Two
3 Three
4 Sub Three 1
5 Sub three 2
6 Four
However using the class 'sub-item' I want this desired behaviour
1 One
2 Two
3. Three
a Sub three 1
b Sub Three 2
4 Four
I can not change the html part of the code, only can write css. Adding nested ol
tags will not work in this case as I can not modify the html.
tag. Just adds the classes.
– Alvina Lakhani Feb 11 '22 at 10:55