HTML Text List Tags
In HTML, lists are used to present a collection of items in a structured format. There are three main types of lists:
- Ordered List or Numbered List
- Unordered List or Bulleted List
- Description List or Definition List
1. Ordered List
- Purpose: To display a list of items in a specific order, usually numbered.
- Tags: <ol>
- Example:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
2. Unordered List
- Purpose: To display a list of items without any specific order or numbering.
- Tags: <ul>
- Example:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
3. Description List
Purpose: To display a list of terms and their corresponding definitions.
Tag: <dl> (for “definition list”), <dt> (for “definition term”), and <dd> (for “definition description”)
Example:
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>