Codectionary / Developer documentation / HTML

<ul>

The <ul> element represents an unordered list of items, typically displayed with bullet points. The order of items has no semantic meaning — use <ol> instead when sequence matters. Every item inside a <ul> must be wrapped in an <li> (list item) element. Unordered lists are commonly used for navigation menus, feature lists, and any collection of related items.

Syntax

<ul>
  <li>Item one</li>
  <li>Item two</li>
</ul>

Examples

Basic List

A simple unordered list.

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

Navigation Menu

Using a list to build a semantic navigation menu.

<nav>
  <ul style="list-style: none; display: flex; gap: 20px; padding: 0;">
    <li><a href="#home">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
  </ul>
</nav>

Nested List

Lists can be nested inside list items to represent hierarchy.

<ul>
  <li>Frontend
    <ul>
      <li>React</li>
      <li>Vue</li>
    </ul>
  </li>
  <li>Backend
    <ul>
      <li>PHP</li>
      <li>Node.js</li>
    </ul>
  </li>
</ul>

Attributes

  • type (disc | circle | square): Deprecated — use the CSS list-style-type property instead

Best practices

  • Only place <li> elements as direct children of <ul>
  • Use <ul> when the order of items does not matter; use <ol> when it does
  • Style bullet appearance with CSS list-style-type rather than the deprecated type attribute
  • Wrap navigation lists in a <nav> element for better accessibility

At a glance

Purpose
Structure and meaning for web content
File extension
.html · .htm
Runs in
Web browsers
Usually used with
CSS and JavaScript

Specifications & further reading

Related HTML documentation