0
<ol>
    <li>a</li>
    <li>b:
        <ol>
            <li>aa</li>
            <li>bb</li>
        </ol>
    </li>
    <li>c</li>
</ol>

I want to make the counter of the second level to be like 1) and 2), is there any build-in way to do this? I think this should be "ordered list's list-style", but I can't find similar property. I know I can use counter related properties, but to use it, I will have to change <li> to other container, otherwise, each list item will display two counters.

Alex Pan
  • 4,341
  • 8
  • 34
  • 45
shenkwen
  • 3,536
  • 5
  • 45
  • 85

4 Answers4

0

Try making first list under ul tag, and rest of the list in ol.

 <ul>
    <li>a</li>
    <li>b:
        <ol>
            <li>aa</li>
            <li>bb</li>
        </ol>
        <li>c</li>
    </ul>
stanze
  • 2,456
  • 10
  • 13
0

If you want your list to be multi-leveled, just add the missing closing li tag.

<ol>
    <li>a</li>
    <li>b:
        <ol>
            <li>aa</li>
            <li>bb</li>
        </ol>
    </li> <!-- this was missing -->
    <li>c</li>
</ol>

Here is a jsfiddle.

Alex Pan
  • 4,341
  • 8
  • 34
  • 45
0

In your code, you didnt closed <li> tag before starting <li> for c, Demo

<ol>
    <li>a</li>
    <li>b:
        <ol>
            <li>aa</li>
            <li>bb</li>
        </ol>
    </li>
    <li>c</li>
</ol>
G.L.P
  • 7,119
  • 5
  • 25
  • 41
0

Missing an <li> closing tag. Fiddle

Kurenai Kunai
  • 1,842
  • 2
  • 12
  • 22