In my html
code I have the following list defined:
<p class="list">first.</p>
<p class="list">second.</p>
Now, in css
I have:
.list {
display: table;
}
.list:before {
display: table-cell;
counter-increment: counter;
content: counter(counter) '.';
padding-right: 5px;
}
and the result on the page is:
1. first
1. second
How can I increment the second number to the value of 2?
You should be using
counter-reset
property on the wrapper of thelist
s - see demo below: