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

vrish88 picture vrish88 · Apr 22, 2009 · Viewed 91.9k times · Source

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. In this specification they say that you can specify the starting integer by using CSS. (instead of the start attribute)

How would you specify the starting number with CSS?

Answer

Travis picture Travis · Apr 22, 2009

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>