HTML nested ordered list

Possible duplicate:
Right way to create a nested HTML list?

I want to do the following in HTML:

1. One 2. Two 1. Inner One 2. Inner Two 3. Three 

One of the methods -

 <ol> <li>One</li> <li>Two</li> <ol> <li>Inner One</li> <li>inner Two</li> </ol> <li>Three</li> </ol> 

But according to the correct way to create a nested HTML list? This is not the right way to do this. The "correct" way gives this:

 1. One 2. Two 3. 1. Inner One 2. Inner Two 4. Three 

So, is there a suitable way to nest ordered lists without extra numbers for nested lists?

+6
source share
3 answers
 <ol> <li>One</li> <li>Two <ol> <li>Inner One</li> <li>inner Two</li> </ol> </li> <li>Three</li> </ol> 

gives

  • One
  • Two
    1. Interior
    2. inner Two
Three

<ul> is for * u * ordered lists.

+16
source

I think you are looking for this:

 <ol> <li>One</li> <li>Two <ol> <li>Inner One</li> <li>inner Two</li> </ol> </li> <li>Three</li> </ol> 

Outputs to:

 1. One 2. Two 1. Inner One 2. Inner Two 3. Three 
+1
source

As stated above, you just need an ordered list

 <ol> <li>one</li> <li>two</li> <ol> <li>inner 1</li> <li>inner 2</li> </ol> <li>three</li> </ol> 
-1
source

Source: https://habr.com/ru/post/926161/


All Articles