Languages

HTML - How to continue numbering from the previous ordered list?

6 points
Asked by:
Olivier-Myers
394

I want to make a list that will not be numbered from the beginning (from 1).
My result:

  1. Some text... 
  2. Some text...

Some text between

  1. Some text...
  2. Some text...

What I want to get:

  1. Some text... 
  2. Some text...

Some text between

  3. Some text...
  4. Some text...

How can I determine the starting value of the list?

1 answer
6 points
Answered by:
Olivier-Myers
394

You can use the start attribute, which specifies what number the ordered list will start with.

Runnable example:

// ONLINE-RUNNER:browser;

<ol>
  <li>Some text...</li>
  <li>Some text...</li>
</ol>

<p>Some text between...</p>

<ol start="3">
  <li>Some text...</li>
  <li>Some text...</li>
</ol>
0 comments Add comment
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join