Documentation

Student-friendly HTML, CSS, and JavaScript reference with examples

Sections

HTML Lists (ul, ol, li)

HTML has two types of lists: unordered lists (bullet points) and ordered lists (numbered).

Unordered List:

<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>

Ordered List:

<ol>
  <li>First step</li>
  <li>Second step</li>
  <li>Third step</li>
</ol>
  • <ul> creates a bulleted list
  • <ol> creates a numbered list
  • <li> is a list item (works in both types)

Lists must contain <li> elements, and <li> elements can only be inside <ul> or <ol>.