Moshe's solution is great but the problem may still exist if you need to put the list inside a div
. (read: CSS counter-reset on nested list)
This style could prevent that issue:
ol > li {_x000D_
counter-increment: item;_x000D_
}_x000D_
_x000D_
ol > li:first-child {_x000D_
counter-reset: item;_x000D_
}_x000D_
_x000D_
ol ol > li {_x000D_
display: block;_x000D_
}_x000D_
_x000D_
ol ol > li:before {_x000D_
content: counters(item, ".") ". ";_x000D_
margin-left: -20px;_x000D_
}
_x000D_
<ol>_x000D_
<li>list not nested in div</li>_x000D_
</ol>_x000D_
_x000D_
<hr>_x000D_
_x000D_
<div>_x000D_
<ol>_x000D_
<li>nested in div</li>_x000D_
<li>two_x000D_
<ol>_x000D_
<li>two.one</li>_x000D_
<li>two.two</li>_x000D_
<li>two.three</li>_x000D_
</ol>_x000D_
</li>_x000D_
<li>three_x000D_
<ol>_x000D_
<li>three.one</li>_x000D_
<li>three.two_x000D_
<ol>_x000D_
<li>three.two.one</li>_x000D_
<li>three.two.two</li>_x000D_
</ol>_x000D_
</li>_x000D_
</ol>_x000D_
</li>_x000D_
<li>four</li>_x000D_
</ol>_x000D_
</div>
_x000D_
You can also set the counter-reset on li:before
.