In HTML, there are several types of lists that can be used to organize and present information:
-
Ordered Lists (<ol>):
- Ordered lists are used to represent a list of items in a sequential order.
- Each item in an ordered list is prefixed with a number or another type of marker.
- The numbering is automatic and follows the order in which the items are listed in the HTML code.
- Example:
<ol> <li>First item</li> <li>Second item</li> <li>Third item</li> </ol>
-
Unordered Lists (<ul>):
- Unordered lists are used to represent a collection of items in no particular order.
- Each item in an unordered list is typically prefixed with a bullet point or another type of marker.
- Example:
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
-
Description Lists (<dl>):
- Description lists are used to present a list of terms along with their descriptions or definitions.
- Each term is marked with <dt>, and its description is marked with <dd>.
- Example:
<dl> <dt>Term 1</dt> <dd>Description of Term 1</dd> <dt>Term 2</dt> <dd>Description of Term 2</dd> </dl>
These list types can be nested within each other to create more complex structures. Lists are commonly used for navigation menus, presenting sets of options, or organizing information in a structured format on web pages.