Starting an HTML Ordered List with a Number Other Than 1

There may be times when you are creating an ordered list on a web page or blog that you need to break out of the list for some commentary and then resume the ordered list where you left off. For example, you might do bullets 1-3, add some commentary that is not part of the ordered list, and then resume the ordered list starting with bullet number 4. But how do you do this with HTML?

Luckily, with HTML it's easy to start an ordered with any number you want. You just have to add the "start=number" attribute to the ordered list -- <ol> -- tag. See below for examples.

Regular Numbered Bullets

HTML Code:

<ol start="4">
<li>This is number 4</li>
<li>This is number 5</li>
<li>This is number 6</li>
</ol>

Output:
  1. This is number 4
  2. This is number 5
  3. This is number 6

Negatively Numbered Bullets

HTML Code:

<ol start="-8">
<li>This is negative 8</li>
<li>This is negative 7</li>
<li>This is negative 6</li>
</ol>

Output:
  1. This is negative 8
  2. This is negative 7
  3. This is negative 6

Roman Numeral Bullets

HTML Code:

<ol start="2" type="i">
<li>This is Roman number 2</li>
<li>This is Roman number 3</li>
<li>This is Roman number 4</li>
</ol>

Output:
  1. This is Roman number 2
  2. This is Roman number 3
  3. This is Roman number 4

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.