There are 3 different types of lists. A <ol> tag starts an ordered list, <ul> for unordered lists, and <dl> for definition lists. Use the type and start attributes to fine tune your lists accordingly.
- <ul> - unordered list; bullets
- <ol> - ordered list; numbers
- <dl> - definition list; dictionary
Use the <ol> tag to begin an ordered list. Place the <li> (list item) tag between your opening <ol> and closing </ol> tags to create list items. Ordered simply means numbered, as the list below demonstrates
HTML Code
<h4 >City</h4>
<ol>
<li>Jalandhar</li>
<li>Ludhiana</li>
<li>Amritsar</li>
</ol>
Output
City
- Jalandhar
- Ludhiana
- Amritsar
Start your ordered list on any number besides 1 using the start attribute
HTML Code
<h4 >City</h4>
<ol start="4">
<li>Jalandhar</li>
<li>Ludhiana</li>
<li>Amritsar</li>
</ol>
Output
City
- Jalandhar
- Ludhiana
- Amritsar
There are 4 other types of ordered lists. Instead of generic numbers you can replace them with Roman numberals or letters, both capital and lower-case. Use the type attribute to change the numbering.
HTML Code
<ol type="a">
<ol type="A">
<ol type="i">
<ol type="I">
Output
Lower-Case Letters |
|
Upper-Case Letters |
|
Lower-Case Numerals |
|
Upper-Case Numerals |
|
- Jalandhar
- Ludhiana
- Amritsar
|
|
- Jalandhar
- Ludhiana
- Amritsar
|
|
- Jalandhar
- Ludhiana
- Amritsar
|
|
- Jalandhar
- Ludhiana
- Amritsar
|
|