Example 1 — Unordered List
<h1>Shopping list</h1>
<ul>
<li>Milk</li>
<li>Bread</li>
<li>Eggs</li>
</ul> How It Works
ul wraps the list; each li is one bullet item. Order does not matter.

HTML lists are a fundamental way to display related items in a structured format. They organize information in a clear hierarchy, making content easier to scan and understand.
HTML supports three main types of lists: unordered lists, ordered lists, and definition lists. This tutorial covers each type, nesting, CSS styling, pitfalls, and six hands-on examples.
Bullet lists.
Numbered steps.
List items.
Term + desc.
Sub-lists.
Style bullets.
There are three main types of lists in HTML:
<ul>) — displayed as bullet points when order does not matter.<ol>) — displayed with numbers or letters when sequence matters.<dl>) — used for terms and their descriptions.Each type serves a different purpose, but they all follow a simple structure that makes organizing content straightforward.
Every list item must be wrapped in <li> (for ul/ol) or paired as <dt> + <dd> (for dl). Place items inside the list container—never after the closing tag.
<ul>)An unordered list displays items in no particular order. Each item is typically marked with a bullet point. The basic structure is:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul> By default, browsers display unordered list items with solid round bullets, but you can customize this with CSS list-style-type. See the ul tag reference for details.
<ol>)An ordered list presents items in a specific sequence. This is useful when order matters—steps in a process, rankings, or instructions:
<ol>
<li>Step 1</li>
<li>Step 2</li>
<li>Step 3</li>
</ol> By default, items are numbered 1, 2, 3… Change the style with CSS instead of the deprecated HTML type attribute:
ol.letters {
list-style-type: upper-alpha; /* A, B, C */
}
ol.roman {
list-style-type: upper-roman; /* I, II, III */
} Learn more in the ol tag reference and list-style-type CSS property.
<dl>)A definition list pairs terms with their descriptions. It is often used for glossaries or to explain concepts. A definition list consists of:
<dt> — defines the term (definition term).<dd> — describes the term (definition description).<dl>
<dt>HTML</dt>
<dd>A markup language for creating web pages.</dd>
<dt>CSS</dt>
<dd>A stylesheet language for designing the look of web pages.</dd>
</dl> One term can have multiple dd elements if several descriptions apply. See the dl tag reference.
Lists can be nested within other lists to create multi-level structures—sub-categories, outlines, or steps within steps. Place the inner list inside an li element:
<ul>
<li>Main Item 1
<ul>
<li>Sub Item 1.1</li>
<li>Sub Item 1.2</li>
</ul>
</li>
<li>Main Item 2</li>
</ul> Sub-items appear indented under the parent item. You can mix ul and ol at different levels (e.g. numbered steps with bullet sub-points).
CSS customizes bullet type, numbering style, and spacing:
ul {
list-style-type: square; /* square bullets */
}
ol {
list-style-type: upper-roman; /* I, II, III */
}
li {
margin-bottom: 0.25rem;
} Remove bullets entirely for navigation-style menus:
ul.nav {
list-style-type: none;
padding-left: 0;
} Common list-style-type values: disc, circle, square, decimal, lower-alpha, upper-alpha, lower-roman, upper-roman, and none.
li, not directly inside another ul or ol alongside sibling li elements.li must be inside ul or ol. Closing the tag before items breaks the list.ul when order is irrelevant; use ol when sequence matters (recipes, instructions).type attribute on ol.| Element | Purpose |
|---|---|
<ul> | Unordered (bullet) list |
<ol> | Ordered (numbered) list |
<li> | Single list item |
<dl> | Definition list container |
<dt> | Term to define |
<dd> | Term description |
list-style-type | CSS: bullet/number style |
list-style: none | CSS: remove markers |
Six examples from a simple bullet list to a full page with every list type. Each includes View Output and Try It Yourself.
<h1>Shopping list</h1>
<ul>
<li>Milk</li>
<li>Bread</li>
<li>Eggs</li>
</ul> ul wraps the list; each li is one bullet item. Order does not matter.
<h1>Recipe steps</h1>
<ol>
<li>Preheat the oven to 180°C</li>
<li>Mix the dry ingredients</li>
<li>Bake for 25 minutes</li>
</ol> ol numbers items automatically. Step order is preserved for the reader.
<dl>
<dt>HTML</dt>
<dd>A markup language for creating web pages.</dd>
<dt>CSS</dt>
<dd>A stylesheet language for designing web pages.</dd>
</dl> dt is the term; dd is the explanation. Ideal for glossaries and metadata.
<style>
ol.alpha { list-style-type: upper-alpha; }
ul.circle { list-style-type: circle; }
</style>
<ol class="alpha">
<li>Item A</li>
<li>Item B</li>
</ol> CSS list-style-type changes markers without changing HTML structure.
<ul>
<li>HTML Basics
<ul>
<li>Headings</li>
<li>Paragraphs</li>
</ul>
</li>
<li>CSS Basics</li>
</ul> The inner ul lives inside the parent li, creating an indented sub-list.
Full example combining unordered, ordered, nested, and definition lists:
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Lists Example</title>
<style>
ul { list-style-type: circle; }
ol { list-style-type: upper-alpha; }
</style>
</head>
<body>
<h1>HTML Lists Example</h1>
<!-- ul, ol, nested ul, and dl sections -->
</body>
</html> Demonstrates every list type from this tutorial on one page with light CSS styling.
ul when order is irrelevantol for steps, rankings, and sequencesli elementslist-style-typeul/ol before li itemsol for unordered feature liststype attribute on olliHTML list elements are supported in every browser. CSS list-style-type values work in all modern browsers; test custom styles on mobile if navigation depends on them.
HTML list elements are supported in every browser. CSS list-style-type values work in all modern browsers; test custom styles on mobile if navigation depends on them.
Bottom line: Lists are among the oldest, most reliable HTML features.
HTML lists provide a simple and effective way to organize information. Understanding unordered, ordered, and definition lists—and how to nest and style them—helps you structure content that is readable, accessible, and easy to maintain.
Next, style text inside your lists with HTML Inputs to collect user data in forms, or explore tag references for ul, ol, and li.
ul, ol, dl.
CoreNo order.
BulletsSequence.
StepsGlossary.
TermsStyle it.
DesignThe HTML menu element once represented toolbars and context menus. Today, use ul with list-style: none for navigation, or the semantic nav element wrapping a list of links.
Create bullet lists, numbered steps, and glossaries, then preview them live.
6 people found this page helpful