HTML Lists
HTML lists are used to organize and display content in a structured manner. Learn how to create ordered, unordered, and description lists in HTML.
Types of HTML Lists
HTML provides different types of lists to display data in various forms. Each list contains one or more list items.
- Unordered List: Displays items using bullets.
- Ordered List: Displays items in a numerical sequence, and supports various numbering styles like Arabic numerals, Roman numerals, and so on.
- Definition List: Organizes items in a format similar to a dictionary, with terms and their corresponding definitions.
An Unordered List
An unordered list uses bullets to display items. It is suitable for listing items where the order doesn't matter. We will soon explore unordered lists in great detail
Syntax of an Unordered List
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>Output of an Unordered List
• Item 1
• Item 2
• Item 3An Ordered List
An ordered list uses numbers or other types of markers to indicate the sequence of items. It's ideal for listing steps in a process or ranking items in order of importance. We will soon explore ordered lists in great detail
Syntax of an Ordered List
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>Output of an Ordered List
1. Item 1
2. Item 2
3. Item 3A Definition List
A definition list arranges items in a way similar to a dictionary, with a term followed by its definition. This is useful for glossaries or to display metadata.
Syntax of a Definition List
<dl>
<h1>Definition List</h1>
<dt>Term 1</dt>
<dd>Definition 1</dd>
<dt>Term 2</dt>
<dd>Definition 2</dd>
</dl>Output of a Definition List
Definition List
Term 1
Definition 1
Term 2
Definition 2In the upcoming sections, we will explore each type of list in detail and learn how to create them in HTML.
Conclusion
HTML lists are a powerful way to organize and display content in a structured manner. They help in presenting information in a clear and concise way. In the next sections, we will explore each type of list in detail and learn how to create them in HTML.
How is this guide?
Sign in to share your feedback
Help us improve by sharing your thoughts on this guide.
Last updated on