On the server side, I am dynamically generating class names like this:
<p class="level_1">List item 1</p>
<p class="level_2">List item 2</p>
<p class="level_3">List item 3</p>
<p class="level_1">List item 1</p>
<p class="level_2">List item 2</p>
<p class="level_1">List item 1</p>
I want the output to have indentation that looks like this:
List item 1
List item 2
List item 3
List item 1
List item 2
List item 1
The class name syntax is level_$i
, where $i
is a variable that can range from 1 to any level. How can I apply CSS to create this indentation in this scenario?