Just Another Blog

Are you thinking what I'm thinking?

Wednesday, October 26, 2005

Setting HTML list counter in a standards-compliant way

In the old-school HTML, one can set the initial value of an ordered list as follow:

<ol start="3">
  <li>List 3</li>
  <li>List 4</li>
  <li>List 5</li>

Of course this doesn't validate. Today I finally realized that there is a standards-compliant (and more flexible) way of doing this:

  <li value="3">List 3</li>
  <li value="5">List 5</li>
  <li>List 6</li>

I should read more documentations. ;-)

Edited: I read the W3C documentation again today. The value attribute was deprecated. Oops…


Note that troll and spam comments will be deleted without any notification.

Post a Comment

<< Home