Numbered lists

Numbered lists are a set of elements with their sequence numbers. The type and type of numbering depends on the parameters of the <OL> tag, which is used to create the list. The following values ​​can be used as markers:

  • Arabic numerals;
  • Uppercase Latin letters;
  • Lowercase Latin letters;
  • Capital roman numerals;
  • Lowercase Roman numerals;

In Table. 1 shows the various parameters of the <OL> tag and the result of their use.

Table. 1. Variants of numbered lists
HTML Code Example
<Ol>
<Li> text </ li>
<Li> text </ li>
<Li> text </ li>
</ Ol>

Numbered list with default parameters:

  1. text
  2. text
  3. text
<Ol start = "5">

Numbered list starting with five:

  1. text
  2. text
  3. text
<Ol type = "A">

Numbered list with capital letters of the Latin alphabet:

  1. text
  2. text
  3. text
<Ol type = "a">

Numbered list with capital letters of the Latin alphabet:

  1. text
  2. text
  3. text
<Ol type = "I">

Numbered list with Roman numerals:

  1. text
  2. text
  3. text
<Ol type = "i">

Numbered list with upper Roman numerals:

  1. text
  2. text
  3. text
<Ol type = "1">

Numbered list with Arabic numerals:

  1. text
  2. text
  3. text
<Ol type = "I" start = "7">

List with Roman numerals starting with seven:

  1. text
  2. text
  3. text


Example 1 shows the creation of a list using Roman numbering.

Example 1. Creating a numbered list

Valid HTML
<! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Roman Numbers </ title>
</ Head>
<Body>

<Ol type = "I" start = "8">
<Li> King Magnum XLIV </ li>
<Li> King Siegfried XVI </ li>
<Li> King Sigismund XXI </ li>
<Li> King Husbrandt I </ li>
</ Ol>

</ Body>
</ Html>

The result of the example is shown below.

Fig. 1. Kind of a numbered list

Fig. 1. Kind of a numbered list in the Opera browser

Note that vertical indents are automatically added before and after the list, this is a feature of the <OL> tag.

Copyright © www.htmlbook.ru