HTML List
HTML List
HTML List
HTML list is of two types.
-
Ordered list
-
Unordered list
HTML Ordered list
- Car
- Bike
- Bicycle
HTML Ordered list is defined by <ol> tag and inside the <ol> tag, list is defined by <li> tag.
Example:
<ol>
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ol>
HTML Unordered list
HTML Unordered list
- Car
- Bike
- Bicycle
HTML Unordered list is defined by <ul> tag and inside the <ul> tag, list is defined by <li> tag.
Example:
<ul>
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ul>
HTML List Type Attribute
Type attributes are used to enhance the property of HTML list.
Ordered List Types
| Type | Description |
|---|---|
| type="1" | The list items start with numbers (default) |
| type="a" | The list items start with lowercase letters |
| type="A" | The list items start with uppercase letters |
| type="i" | The list items start with lowercase roman numbers |
| type="I" | The list items start with uppercase roman numbers |
Example:
<ol type="a">
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ol>
HTML List Type Attribute
Type attributes are used to enhance the property of HTML list.
Ordered List Types
| Type | Description |
|---|---|
| type="1" | The list items start with numbers (default) |
| type="a" | The list items start with lowercase letters |
| type="A" | The list items start with uppercase letters |
| type="i" | The list items start with lowercase roman numbers |
| type="I" | The list items start with uppercase roman numbers |
Example:
<ol type="A">
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ol>
HTML List Type Attribute
Type attributes are used to enhance the property of HTML list.
Ordered List Types
| Type | Description |
|---|---|
| type="1" | The list items start with numbers (default) |
| type="a" | The list items start with lowercase letters |
| type="A" | The list items start with uppercase letters |
| type="i" | The list items start with lowercase roman numbers |
| type="I" | The list items start with uppercase roman numbers |
Example:
<ol type="i">
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ol>
Unordered List Types
| Type | Description |
|---|---|
| type="disc" | The list items start with disc type bullet (default) |
| type="square" | The list items start with circle type bullet |
| type="circle" | The list items start with square type bullet |
| type="none" | The list items will not be marked |
Example:
<ul type="square">
<li>Car</li>
<li>Bike</li>
<li>Bicycle</li>
</ul>
HTML Nested List
In the Nested list, we can put a list inside a list.
Example:
<li>First Item</li>
<li>Second Item</li>
<ul>
<li>First Sub Item</li>
<li>Second Sub Item</li>
<li>Third Sub Item</li>
</ul>
<li>Third Item</li>
</ul>