December 3, 2026 - 08:49
HTML Lesson 07 — Build Lists with ul, ol and li Image
HTML & CSS Tutorials

HTML Lesson 07 — Build Lists with ul, ol and li

0 Comments

A list of tools and a list of instructions are different. “Editor, browser” describes a set of things we need. “Create, save, open” describes a sequence. Swapping the tools changes little; swapping the instructions can make them impossible to follow.

Choose a structure before choosing its appearance

HTML
<h1>Bir sayfa hazırlayalım</h1>
<h2>Gerekenler</h2>
<ul>
  <li>Metin editörü</li>
  <li>Tarayıcı</li>
</ul>
<h2>İşlem sırası</h2>
<ol>
  <li>Dosyayı oluştur.</li>
  <li>İçeriği yaz ve kaydet.</li>
  <li>Tarayıcıda aç.</li>
</ol>

ul creates an unordered list. ol creates an ordered list. Both contain li elements, one for each list item. The Turkish sample separates the required tools from the steps for preparing a page.

Moving “browser” above “editor” does not change the requirements. Moving “open in the browser” above “create the file” changes the instructions. This meaningful order is the reason for using ol.

We did not type “1.” or “2.” into the item text. The browser supplies the numbers. Insert a step in the middle and subsequent numbers adjust automatically. CSS can change the appearance of markers, but the list type still communicates its underlying meaning.

Nest a list inside the item it belongs to

HTML
<ul>
  <li>Web dersleri
    <ul>
      <li>HTML</li>
      <li>CSS</li>
    </ul>
  </li>
  <li>Kitap notları</li>
</ul>

HTML and CSS are subtopics of the web lessons item. The inner ul therefore goes inside that li, before its closing tag. Do not place an unattached inner list directly between the outer list's items.

Follow the opening and closing order: open the outer item, write its text, open and close its inner list, then close the outer item. Indentation makes those boundaries visible while you edit.

Not every sentence needs a bullet

Turning every sentence into an item does not automatically improve an explanation. Related sentences developing one idea usually belong in a paragraph. Lists work well for a real collection of items or a sequence of actions.

Typing asterisks at the start of plain paragraphs can imitate bullets visually, but it does not create a list in the document structure. The list elements tell browsers and assistive tools that the items form a group.

Choose a starting number

HTML
<ol start="3">
  <li>Save the file.</li>
  <li>Open it in a browser.</li>
</ol>

This starts at three and continues at four. It can continue instructions split across sections. Start changes numbering rather than putting a manual number into the text. Check that the chosen start still matches the content after editing.

Individual li elements can use value, and reversed can request descending numbering. These features are useful for an actual continuation or countdown, not merely because an unusual marker looks attractive.

Nesting depends on boundaries

The parent li must remain open while its child list is written. A list appearing on the next source line is not automatically a child. Browser indentation can conceal an incorrect relationship.

Inspect the outer list's direct children: they should be li elements. A nested ul belongs inside its relevant li. Items may also contain paragraphs or links; they are not restricted to one word each.

A description list has another relationship

HTML
<dl>
  <dt>HTML</dt>
  <dd>Describes content structure.</dd>
  <dt>CSS</dt>
  <dd>Controls presentation and layout.</dd>
</dl>

Dl groups names or terms with descriptions. Dt provides the term and dd its explanation. A glossary does not have the same relationship as a sequence of instructions or a set of ingredients.

Choose according to the data: sequence, collection or name-description association. Do not select ol only because you prefer numbers, or dl for steps whose order matters.

Why handwritten markers are different

Paragraphs starting with dashes may look similar but do not necessarily expose a list structure. Actual list elements communicate that their items belong together.

Create an unordered tools list, ordered instructions and a three-term description list. Move one instruction to the beginning and inspect its new number. Automatic numbering does not prove that the edited instructions still make sense.

Add a step in the middle

Insert “Check the file extension” before the final opening step. Confirm that the numbers adjust. Then change the tools list from ul to ol and ask whether its order really carries meaning, rather than merely looking different.

References: MDN

Related Articles

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment