There are 3 types of list in html:

  1. Ordered List
    A list where items are displayed in a specific order using numbers or letters.
  2. Unordered List
    A list where items are displayed with bullet points, without any order.
  3. Definition List
    A list used to define terms with their definition or details.



1. Ordered List Example:

Fruit List

  1. Apple
  2. Mango
  3. Banana
  4. Orange
  5. Grapes

Note: In HTML, we can change the numbering style of an Ordered List by using the type attribute, Example:

Types of numbering:

  1. type="1" → Default numbering (1, 2, 3, 4 …)
  2. type="A" → Uppercase letters (A, B, C, D …)
  3. type="a" → Lowercase letters (a, b, c, d …)
  4. type="I" → Uppercase Roman numbers (I, II, III, IV …)
  5. type="i" → Lowercase Roman numbers (i, ii, iii, iv …).



2. Unordered List Example:

Vegetable List

Note: In HTML, The type attribute changes the bullet style of the list items. It has 3 main values, Example:




3. Definition List Example:

HTML
- HyperText Markup Language
CSS
- Cascading Style Sheets
JavaScript
- A programming language used to make web pages interactive

Note: We can make definition list with numbers by using definition list in order list or unorder list, Example:

  1. HTML
    HyperText Markup Language.
  2. CSS
    Cascading Style Sheets.
  3. JavaScript
    A programming language used to make web pages interactive.



Nested List:

You can put a second list inside an li element to create a sub list or nested list, Example:

  1. Five Vegetables Name:
  2. Five Fruits Name:
    1. Apple
    2. Mango
    3. Banana
    4. Orange
    5. Grapes

Note:You can notice that ol can be used under ul and ul can be used under ol.

Go to top