HTML lists help you organize related items clearly on a web page. They are perfect for menus, steps in a process, feature lists, FAQs, or glossaries. There are three main types of lists: unordered lists for bullet points, ordered lists for numbered or lettered steps, and description lists for term–definition pairs.
<ul>: Used when the order of items is not important. Items appear with bullets.<ol>: Used when order matters. Items are numbered or lettered.<li>: Represents each item inside <ul> or <ol>.<dl>: Used for term–description pairs like glossaries.<dt>: The term in a description list.<dd>: The description or explanation of that term.Unordered lists use <ul>, ordered lists use <ol>, and each item goes inside an <li> tag. Description lists use <dl> with pairs of <dt> and <dd>.
Ordered lists can use attributes like type, start, and reversed:
type: changes markers (e.g., type="1", "a", "A", "i", "I").start: sets the starting number or letter for the first item.reversed: counts downwards instead of upwards.Here is a combined example showing all three kinds of lists:
<!-- Unordered List -->
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
<!-- Ordered List -->
<ol type="a" start="2" reversed>
<li>Second</li>
<li>First</li>
</ol>
<!-- Description List -->
<dl>
<dt>HTML</dt>
<dd>Hypertext Markup Language.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets.</dd>
</dl>
The browser renders each <li> as a bullet or numbered item. In the ordered list, the combination of type="a", start="2", and reversed creates a countdown using letters. In the description list, each <dt> term is followed by its matching <dd> description.
start attribute.type="I" in an ordered list to use Roman numerals.HTML lists are essential for organizing information clearly. Unordered lists show bullet points, ordered lists display numbered or lettered steps, and description lists pair terms with definitions. By choosing the right list type and combining it with semantic HTML and CSS styling, you can make your content easier to scan, understand, and maintain.