Search code examples
htmlcsshtml-lists

Is it possible to specify a starting number for an ordered list?


I have a ordered list where I would like the initial number to be 6. I found that this was supported (now deprecated) in HTML 4.01 using the start attribute. In this specification they say that you can instead specify the starting integer by using CSS.

How would you specify the starting number with CSS?


Solution

  • If you need the functionality to start an ordered list (OL) at a specific point, you'll have to specify your doctype as HTML 5; which is:

    <!doctype html>
    

    With that doctype, it is valid to set a start attribute on an ordered list. Such as:

    <ol start="6">
      <li>Lorem</li>
      <li>Ipsum</li>
      <li>Dolor</li>
    </ol>