Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML nested ordered list [duplicate]

Tags:

html

Possible Duplicate:
Proper way to make HTML nested list?

I'd like to produce the following in HTML:

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

One way is

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

But according to Proper way to make HTML nested list? this is not the proper way to do this. The "proper" way produces this:

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

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

like image 749
jhchen Avatar asked Sep 24 '12 22:09

jhchen


2 Answers

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

gives

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

<ul> is for *u*nordered lists.

like image 52
Eric Avatar answered Sep 19 '22 18:09

Eric


I think, you are searching 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
like image 22
Gloomcore Avatar answered Sep 21 '22 18:09

Gloomcore