I'm trying to do something like this:
<h2>1.1 Bananas</h2>
<h3>1.1.1 </h3>
<h3>1.1.2 </h3>
<h3>1.1.3 </h3>
<h2>1.1 Apples</h2>
<h3>1.1.1 </h3>
<h3>1.1.2 </h3>
<h3>1.1.3 </h3>
<h2>1.1 Oranges</h2>
<h3>1.1.1</h3>
<h3>1.1.2</h3>
<h3>1.1.3</h3>
Notice how the number series repeats.
I can do autonumbering via CSS - but I can't figure out if there's a way to repeat the numbered series.
One way would to be use CSS
counters
and reset them every time ah2
is encountered like in below snippet.The
counter-reset
property within theh2
selector sets the value of theh2
counter to 1 and that of theh3
counter to 0 (default) everytime ah2
element is encountered.The
counter-increment
property within theh3
selector increments the value of theh3
counter everytime ah3
element is encountered.Actually, you don't even need the
h2
counter for your case because the value is always 1. So even the below in CSS would suffice: