Unordered list has each item has a sequential leading symbol. The browser assigns this sequence automatically.
The Ordered list is created using
<ol>..</ol>
block and the item in the list use the
<li>
element. The browser inserts an extra line before the list and indents the list a few spaces to the right.
<ol>
Header of unordered list
<li>
1st list item
<li>
2nd list item
<li>
3rd list item
<ol>
The each item in the list is displayed as leading symbol. The symbol can be
- 1 (Arabic numerals: 1, 2,3..)
- a (Lowercase letters: a, b, c.. etc.)
- A (Uppercase letters: A, B, C.. etc.)
- i (Lowercase Roman Numerals: i, ii, iii.. etc.)
- I (Uppercase Roman Numerals: I, II, III.. etc.)
Attributes of Ordered List
The symbol appearance can be changed using the
type attribute and
start attribute.
type attribute
Using type attribute
snippet
<html>
<head></head>
<body>
<ol type="I"> Header of unordered list
<li> 1st list item
<li> 2nd list item
<li> 3rd list item
<ol>
<body>
<html>
Output
Header of unordered list- 1st list item
- 2nd list item
- 3rd list item
start attribute
Using start attribute
The first symbol in the sequence is 1, a, A, i, I. To change the default setting of the sequence the start attribute is used. If the start element attribute us assigned the value 5 and the type attribute value as A, the sequence will start from "E".
snippet
<html>
<head></head>
<body>
<ol type="I" start="5"> Header of unordered list
<li> 1st list item
<li> 2nd list item
<li> 3rd list item
<ol>
<body>
<html>
Output
Header of unordered list- 1st list item
- 2nd list item
- 3rd list item