Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Lists | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 54 of 55

·HTML

Lists

8 min

Course progress98%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Unordered `<ul>` and ordered `<ol>` usage
  • Definition list `<dl>`, `<dt>`, `<dd>` for key‑value pairs
  • Nesting limits and readability considerations
  • Semantic importance of proper list markup for accessibility
  • Lists

    HTML offers three list types to convey ordered, unordered, and definition data.

    Unordered list

    <ul>
      <li>Apples</li>
      <li>Bananas</li>
      <li>Cherries</li>
    </ul>
    

    Ordered list

    <ol>
      <li>First step</li>
      <li>Second step</li>
    </ol>
    

    Definition list

    <dl>
      <dt>HTML</dt>
      <dd>Markup language for structuring web content.</dd>
      <dt>CSS</dt>
      <dd>Style sheet language for presentation.</dd>
    </dl>
    

    Accessibility notes

    • Use the semantic list elements (<ul>, <ol>, <dl>) instead of generic <div>s – screen readers announce the list type and length automatically.
    • For complex nested lists, keep the nesting depth to a maximum of three levels to preserve readability.
    • CSS list-style-type or the modern ::marker pseudo‑element lets you customise bullets without affecting semantics.
    • When a list represents a set of actions or steps that are not inherently ordered, prefer <ul> with proper headings.

    Quick cheat‑sheet

    • Menu or navigation → <ul> with <a> inside <li>.
    • Procedural steps → <ol>.
    • Key‑value pairs (FAQ, glossary) → <dl>.
    • Custom bullets → list-style-type or ::marker.

    Tip: Avoid mixing list types inside the same parent unless the content truly requires it; it can confuse assistive technology.


    Quick checklist for lists

    1. Correct list element used for the content type? ✅
    2. Nesting depth limited to three levels? ✅
    3. No presentation‑only <div> used in place of a list? ✅
    4. ::marker or list-style-type used for custom bullets? ✅
    5. List headings (<h2>, etc.) present when appropriate? ✅

    If any answer is “no”, refactor the markup now.

    Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
    Previous lessonImagesContinue to lesson 55TablesBack to HTML Course curriculum