HTML Unordered List
An unordered list is a list of items that are not arranged in any specific, sequential order. Unlike ordered lists, the items in an unordered list are typically marked with bullet points, dashes, or other symbols to indicate list membership, but these markers do not imply any particular order.
Syntax for Creating Unordered Lists
To create an unordered list in HTML, you use the <ul>
(unordered list) element along with the <li>
(list item) element for each item within the list. Here's the basic syntax:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Explanation:
- <ul>: This is the opening tag for the unordered list. It indicates the beginning of the list.
- <li>: This is the list item tag. Each individual item in the list is enclosed within <li> tags.
- The content inside the <li> tags represents the text or content of each list item.
- </ul>: This is the closing tag for the unordered list. It indicates the end of the list.
Key Characteristics of Unordered Lists:
- No specific sequence is required.
- Typically displayed as bullet points.
- Defined using the
<ul>
tag. - Individual items use the
<li>
tag.
Basic Example:
<ul>
<li>Pen</li>
<li>Pencil</li>
<li>Eraser</li>
</ul>
Output:
- Pen
- Pencil
- Eraser
Customizing Bullet Points with 'type' Attribute
You can specify the style of bullet points using the type attribute. It supports three values:
- Notebook
- Marker
Output:
- Notebook
- Marker