When I tried to format the ordered list with sub-items, I encountered an issue. There is a nested <ol>
inside a <div>
, but the numbering seems to be incorrect. Can you help me understand why?
OL {
counter-reset: item;
padding-left: 10px;
}
LI {
display: list-item
}
LI:before {
content: counters(item, ".") " ";
counter-increment: item
}
<ol>
<li>one</li>
<li>two
<ol>
<li>two.one</li>
</ol>
</li>
</ol>
<hr />
<div>
<ol>
<li>one
<ol>
<li>one.one</li>
</ol>
</li>
</ol>
</div>
To view and assess the code, please visit: http://jsfiddle.net/PTbGc/1265/