HTML Lists In Depth: Ordered, Unordered, and Description Lists

A complete guide to HTML lists — unordered, ordered, and description lists. Learn the right markup, the attributes that control numbering, how to nest lists, and where each type genuinely belongs.

Published July 31, 202610 min readBy ACY Partner Indonesia
HTML lists — ul, ol, and dl elements with their list items
300 × 250Ad Space AvailablePlace your ad here

Lists are everywhere on the web. Navigation menus, step-by-step instructions, feature bullets, FAQs, product specs — scratch the surface of almost any page and you’ll find a list underneath. They look simple, and the basic markup is simple, but there’s real depth here: three distinct list types, a handful of attributes that control how numbering behaves, rules for nesting, and a few accessibility details that separate sloppy markup from solid markup.

This article takes lists from “I can write a bulleted list” to “I know exactly which list to reach for and how to control it.” If you’ve worked through the earlier HTML pieces — like what HTML is and HTML attributes — you’ve already got the foundation you need. Let’s build on it.

The three kinds of list

HTML gives you three list elements, and they aren’t interchangeable. Picking the right one is half the skill:

  • Unordered list (<ul>) — a set of items where the order doesn’t matter. Shown with bullets by default.
  • Ordered list (<ol>) — a sequence where the order does matter. Shown with numbers by default.
  • Description list (<dl>) — pairs of terms and their descriptions, like a glossary.

The first two are the workhorses you’ll use daily. The third is less common but genuinely useful once you know it exists. We’ll take them one at a time.

Unordered lists with <ul>

An unordered list is a collection of items with no inherent sequence — a shopping list, a set of features, the tags on an article. You build it with a <ul> wrapper and one <li> (list item) per entry:

<ul>
  <li>Coffee</li>
  <li>Milk</li>
  <li>Bread</li>
</ul>

By default the browser renders each item with a bullet point. The key idea is the meaning: by using <ul>, you’re telling the browser, search engines, and screen readers “these things belong together as a group, and their order carries no significance.” Reordering them wouldn’t change what the list means.

Every direct child of a <ul> must be an <li>. You don’t put paragraphs or headings straight inside a <ul> — you put them inside an <li> if you need them:

<ul>
  <li>
    <strong>Free shipping</strong>
    <p>On all orders over $50, no code needed.</p>
  </li>
  <li>
    <strong>Easy returns</strong>
    <p>30 days to change your mind.</p>
  </li>
</ul>

An <li> can hold whatever you like — text, links, images, even another list. It’s a flexible container, not just a one-line slot.

The bullets are styling, not meaning

The dots you see are just the browser’s default presentation, controlled by the list-style CSS property. You can change them to squares, circles, custom images, or remove them entirely. That’s exactly how navigation menus are built: a plain <ul> of links with the bullets switched off in CSS. The element still means “a list” even when it doesn’t look like one — which is great for accessibility.

Ordered lists with <ol>

When sequence matters — steps in a recipe, ranked results, a numbered procedure — reach for <ol>. The markup is identical to <ul>; you just swap the wrapper:

<ol>
  <li>Preheat the oven to 180°C.</li>
  <li>Mix the dry ingredients.</li>
  <li>Add the eggs and stir.</li>
  <li>Bake for 25 minutes.</li>
</ol>

The browser numbers the items automatically — 1, 2, 3, 4 — and, crucially, it keeps that numbering correct if you add, remove, or reorder items. You never hand-type the numbers, which means you can rearrange steps freely without renumbering anything by hand.

The semantic difference is the whole point: an <ol> says “the order of these items is meaningful.” Use it when shuffling the items would break the meaning, and use <ul> when it wouldn’t. “Steps to install the app” is an <ol>. “Reasons our app is great” is a <ul>.

Controlling the numbering

<ol> comes with attributes that let you control how the numbers appear. These are the ones worth knowing:

type changes the marker style. The default is decimal numbers, but you can switch to letters or Roman numerals:

<ol type="A">
  <li>First option</li>   <!-- A -->
  <li>Second option</li>  <!-- B -->
</ol>

The values are 1 (numbers, default), A (uppercase letters), a (lowercase letters), I (uppercase Roman), and i (lowercase Roman).

start sets the number the list begins counting from. Handy when a list is split across sections but the count should continue:

<ol start="5">
  <li>Item five</li>   <!-- 5 -->
  <li>Item six</li>    <!-- 6 -->
</ol>

reversed counts downward instead of up — perfect for a “top 5” countdown:

<ol reversed>
  <li>Bronze</li>   <!-- 3 -->
  <li>Silver</li>   <!-- 2 -->
  <li>Gold</li>     <!-- 1 -->
</ol>

And there’s one attribute that lives on the <li> itself: value lets a single item jump to a specific number, and items after it continue from there:

<ol>
  <li>One</li>            <!-- 1 -->
  <li value="10">Ten</li> <!-- 10 -->
  <li>Eleven</li>         <!-- 11 -->
</ol>

type changes the look — value and start change the count

It’s easy to mix these up. type only affects the appearance of the marker (numbers vs letters vs Roman). start, reversed, and value affect the actual count — what number each item gets. If you later style the list with CSS, the CSS controls appearance and these counting attributes still drive the numbers underneath. Reach for start/value when the number itself must be specific, not just its style.

Description lists with <dl>

The third type is the one people forget exists. A description list is for name–value pairs: a term and its definition, a label and its data. Think glossaries, metadata, or a key-value spec sheet. It uses three elements together:

  • <dl> — the wrapper for the whole list.
  • <dt> — the term being described.
  • <dd> — the description of that term.
<dl>
  <dt>HTML</dt>
  <dd>The markup language that structures web content.</dd>

  <dt>CSS</dt>
  <dd>The language that controls how that content looks.</dd>

  <dt>JavaScript</dt>
  <dd>The language that adds behavior and interactivity.</dd>
</dl>

This isn’t just a styled two-column layout — it carries real meaning. The markup explicitly says “this term goes with this description,” which is information a <ul> of paragraphs could never express. A description list is the honest, semantic choice for any term-and-explanation pairing.

You’re not locked into one-to-one pairs either. A single term can have several descriptions, and several terms can share one description:

<dl>
  <dt>Coffee</dt>
  <dt>Espresso</dt>
  <dd>A hot caffeinated drink.</dd>

  <dt>Author</dt>
  <dd>John Doe</dd>
  <dd>Jane Doe</dd>
</dl>

A great fit for metadata

Description lists shine for displaying structured details — a product’s specs, an article’s author and publish date, the fields of a profile. Wherever you’ve got a set of “label: value” rows, a <dl> is more meaningful than throwing everything into <div>s or a plain bulleted list. It’s an underused element that makes your markup genuinely more descriptive.

Nesting lists

Lists can live inside other lists, which is how you build sub-points and multi-level menus. The rule is precise: a nested list goes inside an <li>, not directly inside the parent <ul> or <ol>. The child list becomes part of the item it belongs to.

<ul>
  <li>Fruit
    <ul>
      <li>Apples</li>
      <li>Bananas</li>
    </ul>
  </li>
  <li>Vegetables
    <ul>
      <li>Carrots</li>
      <li>Spinach</li>
    </ul>
  </li>
</ul>

Notice how the nested <ul> sits between the text “Fruit” and the closing </li> — it’s tucked inside the list item, not floating between items. Browsers indent each level automatically and switch the bullet style as you go deeper, giving you that familiar outline look.

You can mix types freely too. An ordered list of steps can contain an unordered list of sub-notes, and vice versa:

<ol>
  <li>Sign up for an account
    <ul>
      <li>Use a real email address</li>
      <li>Pick a strong password</li>
    </ul>
  </li>
  <li>Verify your email</li>
  <li>Complete your profile</li>
</ol>

Don't put a list directly inside ul or ol

A common mistake is writing a <ul> straight inside another <ul> with no <li> wrapping it. That’s invalid — the only valid direct child of <ul>/<ol> is <li>. The nested list must sit inside an <li>. If your nesting renders oddly or the indentation looks broken, check that every sub-list is wrapped in its parent item. Always close each <li> after its nested list, not before it.

Lists as the backbone of navigation

Here’s something that surprises beginners: most navigation menus on the web are actually unordered lists. The reason is semantic — a nav menu is a group of links with no required order, which is exactly what <ul> means. The bullets just get removed with CSS.

<nav>
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
    <li><a href="/products">Products</a></li>
    <li><a href="/contact">Contact</a></li>
  </ul>
</nav>

Wrapping the links in a <ul> inside a <nav> tells assistive technology “here is a navigation block containing a list of N links.” A screen-reader user hears how many items the menu has before stepping through them. Build the same menu out of bare <a> tags in a <div> and you lose all of that. The list is doing important work even though, visually, it ends up looking nothing like a list. If you’ve read about semantic structure, this is that principle in action.

Accessibility and good habits

Lists are already accessible by default — that’s the payoff for using the right element. A few habits keep them that way:

  • Use the element that matches the meaning. Sequence matters → <ol>. No sequence → <ul>. Term–description pairs → <dl>. Don’t pick based on how the markers happen to look; pick based on what the content is.
  • Don’t fake lists. Lines of text separated by <br>, or a pile of <div>s, might look like a list but tell assistive tech nothing. Screen readers announce real lists (“list, 4 items”) so users can navigate them — a stack of divs gets none of that.
  • Keep <li> as the direct child. Only <li> belongs directly inside <ul>/<ol> (and only <dt>/<dd> inside <dl>). Anything else goes inside those items.
  • Let CSS handle appearance. Need no bullets, custom markers, or a horizontal menu? That’s a styling job. The HTML stays a clean, meaningful list, and you change the look separately.

Generate boilerplate, then understand it

When you’re hand-coding a big list, it’s easy to slip — a missing </li>, a sub-list in the wrong place. A tool like the HTML list generator can scaffold valid <ul>/<ol> markup for you to start from. Use it to save typing, but make sure you can read what it produces — knowing why the structure is correct is what makes you better at HTML, not leaning on the generator.

When to use which — a quick recap

Run any content through these questions and the right element falls out:

  • Does the order matter? Yes → <ol>. No → <ul>.
  • Are these term-and-description pairs?<dl> with <dt> and <dd>.
  • Is it a navigation menu or a set of links/features?<ul> (order doesn’t matter).
  • Are these numbered steps or a ranking?<ol>, and use start/reversed/value if the numbering needs adjusting.

When two options seem to fit, ask the order question first — it settles most cases instantly.

Wrapping up

Lists are one of HTML’s most-used structures, and now you’ve seen all three properly:

  • <ul> is an unordered list — bulleted by default, for groups where order is irrelevant.
  • <ol> is an ordered list — numbered by default, for sequences where order matters. Its type, start, reversed, and value attributes give you full control over the numbering.
  • <dl> is a description list — term (<dt>) and description (<dd>) pairs, ideal for glossaries and metadata.
  • Nesting works by placing a sub-list inside an <li>, and you can mix types freely.
  • Navigation menus are unordered lists with the bullets styled away — a perfect example of meaning over appearance.

The big takeaway is that lists are about meaning, not bullets and numbers. Choose the element that describes your content honestly, and you get clean markup, free accessibility, and styling that’s easy to control. From here, the natural next step is learning how to style these lists with CSS — changing markers, spacing, and turning a vertical menu into a horizontal navbar.

Tags:htmlfrontendlistsintermediate
728 × 90Ad Space AvailablePlace your ad here

Related Articles

See All Articles

You Might Also Like

Frontend best practices overview cover
Frontend / Fundamentals

Frontend Best Practices: An Overview

A friendly map of what good frontend really means — semantic HTML, clean CSS, unobtrusive JavaScript, responsive layouts, performance, and progressive enhancement, with pointers to go deeper.

Sep 20, 20268 min read
A Frontend Developer Roadmap cover with the path HTML to CSS to JavaScript
Frontend / Fundamentals

A Frontend Developer Roadmap: What to Learn, and in What Order

A calm, step-by-step learning path for beginners: HTML, CSS, JavaScript, developer tools, responsive and accessible design, a framework, TypeScript, and deployment, with the reasoning behind each step.

Sep 20, 202611 min read
Title card reading Styling and Interactivity over a dark blue ACY Partner background
Frontend / Fundamentals

How Styling and Interactivity Work

A beginner-friendly look at how CSS turns plain HTML into a designed layout, and how JavaScript adds behavior — the structure, style, behavior mental model for building web pages.

Sep 20, 20269 min read
Three front-end layers combining on one web page
Frontend / Fundamentals

How HTML, CSS, and JavaScript Work Together

A hands-on walkthrough for beginners: build one small button, give it structure with HTML, looks with CSS, and behavior with JavaScript, and watch the three layers cooperate on a real page.

Sep 20, 20268 min read
The Frontend Developer Toolkit cover with editor, browser, and CLI motifs
Frontend / Fundamentals

The Frontend Developer Toolkit

A friendly tour of the everyday tools a frontend developer relies on — code editor, browser and DevTools, terminal, version control, package managers, and a dev server — and what each one is actually for.

Sep 20, 202610 min read
Cover illustration for What Frontend Developers Do
Frontend / Fundamentals

What Frontend Developers Do: A Beginner's Guide to the Role

A clear, beginner-friendly look at what frontend developers actually do every day: turning designs into working interfaces, building reusable UI, and caring about responsiveness, accessibility, and speed.

Sep 20, 202610 min read