HTML ordered lists attributes and some cool tips of the <OL> tag.

Sponsored Links

HTML ordered lists - cool HTMl tips

Here is a cool HTML tip for ordered lists created using <ol> HTML tag.

The type attribute of <ol> list determines which kind of bullet will be used for listing elements.

We can use three types of bullets for the <ol> lists - Alphabet, Roman numerals and numbers/digits.
Take a look at the code below:

<ol type="1">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

The type attribute has been set to 1, Arabic numerals (digits). This is the default and you don't need to specify it.
The above code is rendered in a browser as:

  1. Item 1
  2. Item 2
  3. Item 3

To change the bullets to roman numerals, the TYPE attribute needs to be set to i (lowercase alphabet i) or I (uppercase alphabet I). Let us check these out.

<ol type="i">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
<li>Item 7</li>
<li>Item 8</li>
<li>Item 9</li>
<li>Item 10</li>
<li>Item 11</li>
</ol>
<ol type="I">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
<li>Item 7</li>
<li>Item 8</li>
<li>Item 9</li>
<li>Item 10</li>
<li>Item 11</li>
</ol>

Is rendered as:

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6
  7. Item 7
  8. Item 8
  9. Item 9
  10. Item 10
  11. Item 11

Is rendered as:

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6
  7. Item 7
  8. Item 8
  9. Item 9
  10. Item 10
  11. Item 11

Another attribute, though you may not encounter it often, is START. It takes a number as value and this specifies the number (or alphabet) with which the list would start.

<ol type="1" start="4">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

is rendered as:

  1. Item 1
  2. Item 2
  3. Item 3

<ol type="A" start="10">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

is displayed as:

  1. Item 1
  2. Item 2
  3. Item 3

Page contents: Details of HTML ordered lists, the attributes of the <OL> tag and some great tips to create nice lists for your web pages.

AddThis Social Bookmark Button

Recent Articles