FSM Full Stack Masterclass
Platform under construction
HTML course badge

HTML Elements

Intermediate

HTML List Elements

Learn ul, ol, li, dl as part of the HTML element system: when to use it, how it fits inside a document and what mistakes to avoid.

Lists

Lists turn related items into readable structure.

Lists are for grouped items. Use unordered lists when order does not matter, ordered lists when sequence matters and description lists for term-description pairs.

Navigation menus, feature lists, steps, definitions and checklists are all better when the list structure is real HTML.

Element group: ul, ol, li, dl. Grouped items, ordered steps and term-description pairs.

What belongs here

Learn the tags by job, not by memorizing a random list.

ul

An unordered list where sequence is not important.

ol

An ordered list where steps or ranking matter.

li

A list item inside ul or ol.

dl, dt, dd

Description lists for terms and their explanations.

Syntax in context

Choose the list type based on whether order matters.

If changing the order changes the meaning, use ol. If it does not, use ul. If each item has a term and explanation, use dl.

<ol>
  <li>Create the HTML file.</li>
  <li>Add the document structure.</li>
  <li>Open it in the browser.</li>
</ol>

<dl>
  <dt>HTML</dt>
  <dd>Structure of the page.</dd>
</dl>

Good versus weak

The difference is usually meaning, not only syntax.

Good

<ol>
  <li>Create the HTML file.</li>
  <li>Add the document structure.</li>
  <li>Open it in the browser.</li>
</ol>

<dl>
  <dt>HTML</dt>
  <dd>Structure of the page.</dd>
</dl>

Weak

1. Create the HTML file<br>
2. Add the document structure<br>
3. Open it in the browser<br>

HTML quick reference

Reusable examples for quick reference.

Use these patterns when you need the syntax quickly. Each example has its own anchor, so search engines and readers can land directly on the exact pattern instead of only at the top of the lesson.

Semantic pattern

HTML pattern 1

A clean version of the markup from this lesson. Use it when you need the correct HTML shape quickly.

<ol>
  <li>Create the HTML file.</li>
  <li>Add the document structure.</li>
  <li>Open it in the browser.</li>
</ol>

<dl>
  <dt>HTML</dt>
  <dd>Structure of the page.</dd>
</dl>
What this gives you

Meaningful markup that stays understandable before CSS and JavaScript are added.

Editable lab starter

HTML pattern 2

The starting point from the practice lab. Change the HTML first, then use CSS only for presentation.

<section class="demo-card">
  <h1>Launch checklist</h1>
  <ol>
    <li>Write semantic HTML.</li>
    <li>Add responsive CSS.</li>
    <li>Test in the browser.</li>
  </ol>
</section>
What this gives you

A complete practice snippet that shows how the HTML behaves in context.

Pattern to avoid

HTML pattern 3

A weak pattern from the lesson. Use it as a warning sign when reviewing real pages.

1. Create the HTML file<br>
2. Add the document structure<br>
3. Open it in the browser<br>
What this gives you

A recognizable mistake you can search for and refactor.

Rules that matter

Use these rules before publishing real HTML.

Use li correctly

ul and ol should contain li elements as direct list items.

Order has meaning

Use ol for instructions, rankings and numbered processes.

Menus can be lists

Navigation links are often a list of related destinations.

Description lists are useful

Use dl for glossaries, metadata and FAQ-like term pairs.

Production thinking

HTML is also for accessibility, SEO, security and maintenance.

Why does this matter?

Beginners often ask why this is not just a div with styling. The reason is that HTML is read by browsers, search engines, screen readers and future developers. Clear meaning makes the page easier to use and maintain.

Accessibility

Real lists announce item counts and list structure, which makes scanning easier for assistive technology users.

Production note

List markup is ideal for nav menus, pricing features, documentation steps, filters and structured content blocks.

Live code lab

Change the code and run the example.

Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.

Mini assignment

Try this now.

  • Change one tag, attribute or text value in the example.
  • Run the preview and describe exactly what changed.
  • Reset the lab and repeat the same change without looking at the original.

Practice assignment

Do this before moving to the next lesson.

  1. Change one meaningful part of the HTML, not only the visible text.
  2. Run the preview and check whether the result still makes semantic sense.
  3. Explain why the element or attribute you changed belongs in this exact place.

Try it yourself

Build lists that carry meaning

Live preview

Self-check

Before you continue, prove that you own this lesson.

Intermediate

Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.

  1. Can you explain what problem this lesson solves in a real website?
  2. Can you identify the most important tag or attribute from this lesson?
  3. Can you name one accessibility mistake this lesson helps prevent?
  4. Can you write one good example and one weak example without copying the page?
  5. Can you explain when you would use this in production and when you would avoid it?