Numbered lists in HTML

Numbered lists in HTML
 
Numbered lists in HTML
  • Currently 0 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0/5 (0 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


Numbered list is a list of items each having its own numbers. The style and the type of numbered list depends on the ol tag, which is used to create it. Markers can have the following values:

  • Arabic numerals;
  • Uppercase letters;
  • Lower-case letters;
  • Capital Roman numerals;
  • Lowercase Roman numerals;

Table 1 shows various parameters of the ol tag and their results.

Table 1. Various numbered lists.

HTML code

Example

<ol>
  <li>text</li>
  <li>text</li>
  <li>text</li>
</ol>

Numbered list with default settings:

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

Numbered list that starts 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 lower-case 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 lower-case 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 that start with seven:

  1. text
  2. text
  3. text

Example 1 shows how to create a list using Roman numerals.

Example 1. Creating numbered list.

<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>

The result of this example is shown below.

  1. King Magnum XLIV
  2. King Siegfried XVI
  3. King Sigismund XXI
  4. King Husbrandt I

Note that before and after the list vertical spacings are automatically added, it's one of the features of the ol tag.


 

Read also

Bulleted lists in HTML

Bulleted lists in HTML

Nested lists in HTML

Nested lists in HTML

Post comment

basicuse.net
html5_css
106160485398655174790

Quick navigation

General navigation