Lists

Unordered list

The <ul> element represents an unordered list of items, typically rendered as a bulleted list.

Example:

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

Read more at MDN Web Docs: The Unordered List element

Ordered list

The <ol> element represents an ordered list of items, typically rendered as a numbered list.

Example:

  1. Item one
  2. Item two
  3. Item three
<ol>
  <li>Item one</li>
  <li>Item two</li>
  <li>Item three</li>
</ol>

Read more at MDN Web Docs: The Ordered List element

start attribute

Use the start attribute to start at a specific number. e.g. <ol start="7">

  1. Item seven
  2. Item eight
  3. Item nine

type attribute

Use the type attribute to change the numbering e.g. <ol type="i">

  1. HTML
  2. CSS
  3. JavaScript

Nested lists

Lists can be nested inside each other esaily

  1. Item one
  2. Item two
    • Nested item one
    • Nested item two
    • Nested item three
  3. Item three
<ol>
  <li>Item one</li>
  <li>Item two
    <ul>
      <li>Nested item one</li>
      <li>Nested item two</li>
      <li>Nested item three</li>
    </ul>
  </li>
  <li>Item three</li>
</ol>