logo logo

Different Atributes of Ordered list

The start attribute

Normally, browsers automatically number ordered list items beginning with the Arabic numeral 1. The start attribute for the <ol> tag lets you change that beginning value. To start numbering a list at 5, for example:

<ol start=5>
  <li> This is item number 5.
  <li> This is number six!
  <li> And so forth...
</ol>

The type attribute

By default, browsers number ordered list items with a sequence of Arabic numerals. Besides being able to start the sequence at some number other than 1, you can use the type attribute with the <ol> tag to change the numbering style itself. With the <ol> tag, the type attribute may have a value of “A” for numbering with capital letters, “a” for numbering with lowercase letters, “I” for capital Roman numerals, “i” for lowercase Roman numerals, or “1″ for common Arabic numerals. (See Table 8.1).

Table 8.1: HTML 3.2 type values for numbering ordered lists
Type Value Generated Style Sample Sequence
A Capital letters A, B, C, D
a Lowercase letters a, b, c, d
I Capital Roman numerals I, II, III, IV
i Lowercase Roman numerals i, ii, iii, iv
1 Arabic numerals 1, 2, 3, 4

The start and type attribute extensions work in tandem. The start attribute sets the starting value of the item integer counter at the beginning of an ordered list. The type attribute sets the actual numbering style. For example, the following ordered list starts numbering items at 8, but because the style of numbering is set to i, the first number is the lowercase Roman numeral, “viii.” Subsequent items are numbered with the same style, each value incremented by 1 as shown in this example:

<ol start=8 type="i">
  <li> This is the Roman number 8.
  <li> The numerals increment by 1.
  <li> And so forth...
</ol>

The results are shown in Figure 8.3.

bottom

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

bottom