0Pricing
HTML Academy · Lesson

Unordered Lists ul and li

Build bulleted lists with ul and li elements.

Unordered Lists ul and li is a free HTML Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the HTML Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Is an Unordered List?

An unordered list displays items with bullet points — order does not matter:

<ul>
  <li>HTML</li>
  <li>CSS</li>
  <li>JavaScript</li>
</ul>

The ul Element

The <ul> (unordered list) element wraps the list. Only <li> elements should be direct children:

<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>
<!-- ul = unordered list (bullet points by default) -->
<!-- li = list item -->
<!-- Never put text directly inside ul without li -->

Styling Bullets with CSS

Control list markers with CSS:

ul {
  list-style-type: disc;       /* default: filled circle */
  /* circle, square, none */
}

/* Custom bullet with ::before */
ul li::before {
  content: '→ ';
  color: blue;
}

/* Remove all list styling: */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

Navigation as ul

Navigation menus are semantically a list of links:

<nav>
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
    <li><a href="/blog">Blog</a></li>
    <li><a href="/contact">Contact</a></li>
  </ul>
</nav>

li Can Contain Any Content

List items can hold any flow content:

<ul>
  <li>
    <strong>HTML</strong>
    <p>The structure of the web.</p>
  </li>
  <li>
    <strong>CSS</strong>
    <p>The presentation layer.</p>
  </li>
</ul>

Inline Lists

Display list items horizontally with CSS:

<ul class="inline-list">
  <li>HTML</li>
  <li>CSS</li>
  <li>JS</li>
</ul>

<!-- CSS: -->
<!--
.inline-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
}
-->

Semantic Uses of ul

Common semantic uses for unordered lists:

  • Navigation menus
  • Feature lists
  • Tag clouds
  • Related links
  • Ingredient lists in recipes

ul vs p for Multiple Items

When you have multiple related items, a list is semantically better than separate paragraphs:

<!-- Bad: items that are actually a list -->
<p>- HTML</p>
<p>- CSS</p>
<p>- JavaScript</p>

<!-- Good: -->
<ul>
  <li>HTML</li>
  <li>CSS</li>
  <li>JavaScript</li>
</ul>

List Markers with list-style-image

Use a custom image as the list bullet:

ul {
  list-style-image: url('/icons/check.svg');
}

/* More reliable: use background-image on li::before */
ul li {
  list-style: none;
  padding-left: 1.5rem;
  background: url('/icons/check.svg') no-repeat left center;
  background-size: 1rem;
}

list-style Shorthand

The list-style shorthand sets type, position, and image:

ul {
  list-style: square inside;    /* type + position */
  list-style: none;             /* remove bullets */
}

/* list-style-position: inside vs outside */
ul {
  list-style-position: inside;  /* bullet inside padding box */
  /* outside = default, bullet outside text block */
}

Accessibility

Accessibility notes for lists:

  • Screen readers announce the list type and item count
  • Using list-style: none may cause some screen readers to not announce it as a list — add role="list" to preserve semantics
<ul style="list-style: none" role="list">
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

Quick Check

What is the only valid direct child element of ul?

Recap: Unordered Lists

Unordered list essentials:

  • <ul> wraps a list where order does not matter
  • <li> is the only valid direct child
  • Default bullet: disc; change with list-style-type
  • Navigation menus are semantically <ul> lists of links
  • Add role="list" if you remove bullets with CSS

Frequently asked questions

Is the “Unordered Lists ul and li” lesson free?

Yes — the full text of “Unordered Lists ul and li” is free to read here on the web, and the HTML Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the HTML Academy course, upgrade to CoddyKit PRO.

What will I learn in “Unordered Lists ul and li”?

Build bulleted lists with ul and li elements. You practise HTML Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start HTML Academy?

No prior experience is required. HTML Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Unordered Lists ul and li” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this HTML Academy lesson?

Yes. Every HTML Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Unordered Lists ul and li
  2. Ordered Lists ol start reversed type
  3. Description Lists dl dt dd
  4. Nested Lists and List Styling
← Back to HTML Academy