HTML list
HTML supports ordered, unordered, and defined lists:
HTML list
Ordered list
First list item
Second list item
Third list item
Unordered list
List item
List item
List item
HTML unordered list
An unordered list is a list of items marked with bold dots (typical small black circles).
Unordered list usage <ul>
label
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
The browser displays as follows:
Coffee
Milk
HTML ordered list
Similarly, an ordered list is a list of items, which are marked with numbers. The ordered list begins with <ol>
label. Each list item starts with <li>
label.
List items are marked with numbers.
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
The browser displays as follows:
Coffee
Milk
HTML Custom list
A custom list is not just a list of items, but a combination of projects and their comments.
Customize the list to <dl>
label begins. Each custom list item is specified by <dt>
start. Each custom list item is defined with <dd>
start.
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
The browser displays as follows:
- Coffee
Black hot drink
- Milk
White cold drink
Precautions-useful Tip
Tip: paragraphs, newline characters, pictures, links, and other lists can be used inside list items.
HTML list label
Label |
Description |
---|---|
< ol > |
Define an ordered list |
< ul > |
Define an unordered list |
< li > |
Define list items |
< dl > |
Definition list |
< dt > |
Custom list item |
< dd > |
Define the description of a custom list item |