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?这不是执行此操作的正确方法。 “正确”的方式会产生以下结果:

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

那么,有没有一种合适的方法来嵌套有序列表,而嵌套列表不会出现多余的数字呢?

最佳答案

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




  • 一个

  • 内在一位
  • 内部两个
  • 三个
  • <ul>用于* u *无序列表。

    10-04 16:47
    查看更多