🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

HTML Unordered Lists | HTML5 Tutorial

Master HTML Unordered Lists (<ul>). Learn how to implement semantic bulleted lists, manage non-sequential data, and build modern navigation menus.

Narrated Video Summary
data-composition-id="html-html-unordered-lists"1280×720 @ 30fps10 clips4:03 total

Introduction to Unordered Lists

When items logically belong together but their specific order does not impact the meaning—such as a list of product features, ingredients, or site links—we use the Unordered List. The `<ul>` element is the semantic container for non-sequential data sets. It provides structure without implying a strict sequence, allowing both browsers and screen readers to group related items effectively.

The Bullet Container

The `<ul>` tag acts as the parent container. Inside, every individual item must be wrapped in an `<li>` (List Item) tag. Instead of numbers, browsers visually prefix `<li>` elements within a `<ul>` with bullet points (typically solid discs). This styling signals to the user that all items carry equal weight and can be read in any order.

The Navigation Pattern

One of the most critical and ubiquitous uses for the `<ul>` element is building site navigation. Because a menu is fundamentally just a non-sequential list of links, wrapping them in a `<ul>` inside a `<nav>` landmark is the global accessibility standard. Developers then use CSS to strip away the default bullet points and align the list items horizontally to create a standard navigation bar.

Nesting and Visual Depth

Unordered lists can be nested inside one another to create multi-level hierarchies, such as dropdown menus or categorized feature sets. To properly nest a list, the child `<ul>` must be placed entirely *inside* an `<li>` element. Browsers automatically recognize this depth and will change the default bullet style (for example, from a solid disc to a hollow circle) to visually communicate the nested relationship to the user.

List Style Types

While standard CSS is the modern way to style lists, HTML traditionally used the `type` attribute on `<ul>` to change the bullet style, and CSS now uses the `list-style-type` property. You can easily switch the marker from a 'disc' to a 'circle', a 'square', or remove it entirely with 'none'. Removing the marker is the crucial first step when converting a standard bulleted list into a navigation menu.

CSS Removal of Bullets

To build clean UI components like tag clouds or nav bars, we often need the semantics of a list without the visual noise of bullets. We use the CSS declaration `list-style-type: none;` applied to the `<ul>` element. This instantly hides all bullet markers for every `<li>` inside it. In professional codebases, this is one of the most frequently applied resets to list structures.

Using Icons as Bullets

Modern designs often replace standard bullets with custom SVG icons, emojis, or checkmarks. Rather than using the native `list-style-image`, developers typically remove the native bullet entirely and use CSS pseudo-elements (`::before`) to inject a custom icon perfectly aligned with the text. This gives you ultimate control over the size, color, and positioning of the custom list marker.

Unordered Lists Mastered

Unordered list mastery complete! You now have the perfect architectural tool for building navigation menus, feature sets, and grouped data where sequence does not dictate meaning. By combining `<ul>` and `<li>` tags, you provide clear relationships for screen readers and stable foundations for CSS styling.

Up Next: Visual Assets

With our text formatting and data organization techniques firmly established, it is time to bring your pages to life visually. In our next module, we will explore HTML Images—learning how to embed graphics, optimize them for performance, and ensure they are fully accessible to all users.

0:00 / 4:03
Scene 1 / 10 — Introduction to Unordered Lists
Total XP: 0|💻 html XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Bullet Node

Non-Sequential Set.


🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

Information is rarely linear. When building feature sets or navigation menus, the unordered list provides the semantic foundation for grouping items where sequence doesn't matter.

1The Bullet Container

When items logically belong together but their specific order does not impact the meaning—like a list of product features—we use the Unordered List. The <ul> tag acts as the parent container. Inside, every individual item must be wrapped in an <li> (List Item) tag.

Instead of numbers, browsers visually prefix <li> elements within a <ul> with bullet points (typically solid discs). This styling signals to the user that all items carry equal weight and can be read in any order. The <ul> provides structure without implying a strict sequence, allowing both browsers and screen readers to group related items effectively.

+
<ul>
  <li>Fast performance</li>
  <li>Secure data</li>
</ul>
localhost:3000
Browser Output
  • Fast performance
  • Secure data

3Nesting and Visual Depth

Unordered lists can be nested inside one another to create multi-level hierarchies, such as dropdown menus or categorized feature sets. To properly nest a list, the child <ul> must be placed entirely *inside* an <li> element. Do not place a <ul> as a direct child of another <ul>.

Browsers automatically recognize this depth and will change the default bullet style (for example, from a solid disc to a hollow circle, and then to a square) to visually communicate the nested relationship to the user.

+
<ul>
  <li>Beverages
    <ul>
      <li>Coffee</li>
      <li>Tea</li>
    </ul>
  </li>
</ul>
localhost:3000
Browser Output
  • Beverages
    • Coffee
    • Tea

4Step-by-Step Breakdown

Introduction to Unordered Lists. When items logically belong together but their specific order does not impact the meaning—such as a list of product features, ingredients, or site links—we use the Unordered List. The <ul> element is the semantic container for non-sequential data sets. It provides structure without implying a strict sequence, allowing both browsers and screen readers to group related items effectively.

The Bullet Container. The <ul> tag acts as the parent container. Inside, every individual item must be wrapped in an <li> (List Item) tag. Instead of numbers, browsers visually prefix <li> elements within a <ul> with bullet points (typically solid discs). This styling signals to the user that all items carry equal weight and can be read in any order.

The Navigation Pattern. One of the most critical and ubiquitous uses for the <ul> element is building site navigation. Because a menu is fundamentally just a non-sequential list of links, wrapping them in a <ul> inside a <nav> landmark is the global accessibility standard. Developers then use CSS to strip away the default bullet points and align the list items horizontally to create a standard navigation bar.

Checkpoint: Choosing the correct structural tag informs assistive technologies about the nature of your data. Which tag is used to create a list where items are marked with bullets, indicating that the sequence of the items is not strictly important?

  • <ol> (Ordered List)
  • <ul> (Unordered List)
  • <list>

Nesting and Visual Depth. Unordered lists can be nested inside one another to create multi-level hierarchies, such as dropdown menus or categorized feature sets. To properly nest a list, the child <ul> must be placed entirely *inside* an <li> element. Browsers automatically recognize this depth and will change the default bullet style (for example, from a solid disc to a hollow circle) to visually communicate the nested relationship to the user.

Checkpoint: It's important to separate visual appearance from semantic meaning. True or False? Even though we use CSS to hide the bullet points and arrange the links horizontally, an Unordered List (<ul>) remains the global accessibility standard and structural choice for building web navigation menus.

  • True
  • False (You should just use generic divs)

Checkpoint: HTML parsing rules enforce strict parent-child relationships for lists. Which specific tag MUST wrap every single item inside an unordered (or ordered) list for the HTML to be considered valid?

  • <item>
  • <li> (List Item)
  • <bullet>

List Style Types. While standard CSS is the modern way to style lists, HTML traditionally used the type attribute on <ul> to change the bullet style, and CSS now uses the list-style-type property. You can easily switch the marker from a 'disc' to a 'circle', a 'square', or remove it entirely with 'none'. Removing the marker is the crucial first step when converting a standard bulleted list into a navigation menu.

CSS Removal of Bullets. To build clean UI components like tag clouds or nav bars, we often need the semantics of a list without the visual noise of bullets. We use the CSS declaration list-style-type: none; applied to the <ul> element. This instantly hides all bullet markers for every <li> inside it. In professional codebases, this is one of the most frequently applied resets to list structures.

Checkpoint: When building a modern navigation bar, you must first eliminate the default list styling. Which exact CSS property and value pair accomplishes this?

  • bullets: none
  • list-style-type: none
  • text-decoration: none
  • marker: hidden

Using Icons as Bullets. Modern designs often replace standard bullets with custom SVG icons, emojis, or checkmarks. Rather than using the native list-style-image, developers typically remove the native bullet entirely and use CSS pseudo-elements (::before) to inject a custom icon perfectly aligned with the text. This gives you ultimate control over the size, color, and positioning of the custom list marker.

Unordered Lists Mastered. Unordered list mastery complete! You now have the perfect architectural tool for building navigation menus, feature sets, and grouped data where sequence does not dictate meaning. By combining <ul> and <li> tags, you provide clear relationships for screen readers and stable foundations for CSS styling.

Up Next: Visual Assets. With our text formatting and data organization techniques firmly established, it is time to bring your pages to life visually. In our next module, we will explore HTML Images—learning how to embed graphics, optimize them for performance, and ensure they are fully accessible to all users.

Build An Unordered List. <ul> holds a set of unordered <li> items.

Level Up 🚀

Advanced cheat sheets, SEO tricks, and interview prep for this topic.

Browser Support

ChromeSupported

Fully supported.

FirefoxSupported

Fully supported.

SafariSupported

Fully supported.

EdgeSupported

Fully supported.

Accessibility (A11y)

1Screen Readers Announce List Semantics and Item Count Automatically

A properly formed `<ul>` is announced as a list with its total number of items upfront, letting users decide whether to dive in item by item or skip past — content faked with line-broken `<div>`s or `<br>` tags gets none of this.

2Never Build a Navigation Menu From Bare Links With No List Wrapper

A navigation menu's links should be wrapped in a `<ul>`/`<li>` structure inside `<nav>` — this gives screen readers the item count and list navigation shortcuts, rather than treating each link as an isolated, uncounted element.

SEO Implications

  • 1

    Lists Help Search Engines Recognize Grouped, Related Items

    Search engines use list markup as a structural signal that a set of items are related and equally weighted (like a feature list or a set of navigation links) — this can improve how snippets or sitelinks are generated from that content.

  • 2

    Don't Fake List Appearance With Styled `<div>`s or Manual Bullet Characters

    Using a literal '•' character or a CSS `::before` bullet on a `<div>` gives zero structural signal to crawlers about the content being a cohesive set of related items — genuine `<ul>`/`<li>` markup is what actually conveys that.

Best Practices

Never Put a `<li>` Directly Inside Anything Other Than `<ul>`, `<ol>`, or `<menu>`

`<li>` has no valid meaning as a child of a `<div>` or other generic container — always ensure list items are direct children of an actual list-type parent element.

Use `<ul>` for Navigation Menus Even When Visually Displayed as a Horizontal Bar

The semantic correctness of `<ul>`/`<li>` for a set of navigation links doesn't depend on the visual layout — CSS Flexbox can render the same `<ul>` horizontally with zero bullets, while keeping the accessible list structure intact.

Frequent Bugs

THE BUG

A screen reader announces a supposed 'list' of items with zero count and no list navigation shortcuts available.

THE FIX

The 'list' was actually built from styled `<div>`s with manual bullet characters or CSS `::before` pseudo-elements rather than real `<ul>`/`<li>` markup — replace it with genuine list elements to get real list semantics.

THE BUG

Removing default bullet styling with `list-style: none` seems to also remove the list's accessibility semantics in some browsers.

THE FIX

This is a known quirk in a few older browser/screen-reader combinations where `list-style: none` can suppress the announced list role. If this is a concern for your target audience, an explicit `role="list"` on the `<ul>` and `role="listitem"` on each `<li>` restores the semantics regardless of the CSS applied.

Real-World Examples

Horizontally-Styled Navigation Built on a Real List

A site's top navigation bar looks like a horizontal row of links with no bullets, but is built on genuine `<ul>`/`<li>` markup underneath, preserving list semantics for screen readers while achieving the desired visual layout via CSS.

<nav aria-label="Primary">
  <ul style="display: flex; list-style: none; gap: 20px;">
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
  </ul>
</nav>

Interview Prep

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Placing direct text or <p> tags directly inside <ul>/<ol>

<!-- Wrong --> <ul> <p>My list:</p> <li>Item 1</li> </ul> <!-- Correct --> <p>My list:</p> <ul> <li>Item 1</li> </ul>

The Solution //

The ONLY valid direct children of <ul> or <ol> elements are <li> elements. Put your text or other tags inside the <li>.

The Error //

Using lists merely for indentation

<!-- Wrong --> <ul> <ul> This text is indented. </ul> </ul> <!-- Correct --> <p style="margin-left: 40px;">This text is indented.</p>

The Solution //

Never use <ul> or <li> just to indent text visually. Use CSS margins or padding instead.

Lesson Glossary

[01]ul

Unordered List; a list container that uses bullet points to mark its child items.

Code Preview
<ul>

[02]Bullet Point

A small graphic symbol (usually a dot) used to mark items in a list.

Code Preview
UI

[03]disc

The default bullet style for top-level unordered lists.

Code Preview

[04]circle

The default bullet style for second-level nested unordered lists.

Code Preview

[05]Navigation Menu

A set of links that help users navigate through a website, typically structured as a list.

Code Preview
UX

[06]Semantic Equality

The principle that all items in a set share the same level of importance.

Code Preview
Logic

Continue Learning