0

I am just using simple HTML to code something like this:

This is what I wanted to code:

But this is the output I’m getting:

The section 1.2 should have started from II instead of III because of the outer ordered list.

This is the code I am using:

<h1>Table of Contents For My Book</h1>
<ol>
  <li>Chapter One</li>
  <ol type="I">
    <li>Section 1.1</li>
    <ol type="i">
      <li>First Topic</li>
      <li>Second Topic</li>
      <ul>
        <li>subtopic 1</li>
        <li>subtopic 2</li>
      </ul>
    </ol>
    <li>Section1.2</li>
    <li>Section1.3</li>
  </ol>
Sebastian Simon
  • 18,263
  • 7
  • 55
  • 75

1 Answers1

-1

Try nesting the list as follows:

<h1>Table of Contents For My Book</h1>
<ol>
  <li>Chapter One
    <ol type="I">
      <li>Section 1.1
        <ol type="i">
          <li>First Topic</li>
          <li>Second Topic
          <ul>
            <li>subtopic 1</li>
            <li>subtopic 2</li>
          </ul>
         </li>
        </ol>
      </li>
      <li>Section1.2</li>
      <li>Section1.3</li>
    </ol>
  </li>
  <li>Chapter Two</li>
</ol>
Chüngel
  • 375
  • 4
  • 19