Coding Hubs School of AI – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 8448811540
Back to HTML Notes
Topic #501

Lists (Overview)

HTML gives you three list types — ordered, unordered, and description lists — for grouping related items so both browsers and assistive technology understand them as a genuine list, not just visually indented text.

Why Real List Markup Matters

A screen reader announces "list, 4 items" when it hits a real <ul> or <ol>, giving the user a sense of scope before diving in. Text that just looks like a list (dashes and line breaks) gives none of that.

Syntax

<ul>
    <li>Unordered item</li>
</ul>

<ol>
    <li>Ordered item</li>
</ol>

<dl>
    <dt>Term</dt>
    <dd>Definition</dd>
</dl>

Basic Example

<h2>What You'll Learn</h2>
<ul>
    <li>HTML fundamentals</li>
    <li>CSS layout and styling</li>
    <li>JavaScript basics</li>
</ul>

Browser output: three bulleted lines by default — the browser adds the bullet marker and indentation automatically; you never type bullet characters yourself.

Choosing the Right List Type

List typeUse when...
Unordered (<ul>)Order genuinely doesn't matter — features, ingredients, navigation links
Ordered (<ol>)Sequence matters — steps in a recipe, ranked results, instructions
Description (<dl>)Pairing terms with their definitions or values — a glossary, key-value metadata

Common Mistakes

  • Faking a list with manual dashes/bullets and <br> tags instead of real <ul>/<li> markup
  • Choosing <ul> when the content is genuinely sequential (like numbered steps) — that should be <ol>

Best Practices

  • Always use real list markup for anything that's genuinely a list of items
  • Pick <ol> vs <ul> based on whether sequence actually matters to the content's meaning

Accessibility Considerations

Real list markup lets screen readers announce the list's scope ("list, 5 items") upfront, and lets users jump between list items with dedicated navigation shortcuts — none of which works on visually-faked lists.

SEO Considerations

Well-structured lists are more likely to be pulled into rich search results like featured snippets — search engines specifically look for real <ol>/<ul> markup for "how to" and "best X" style content.

Browser & Modern HTML Notes

All three list elements have been part of HTML since its earliest versions and remain unchanged today — a genuinely stable corner of the language.

Mini Practice

  1. Build a short unordered list of your three favorite programming languages.
  2. Rewrite a "step 1, step 2, step 3" paragraph as a proper ordered list.

Related HTML Notes

Ready to combine HTML with real layout and interactivity? CodingNow's Full Stack course covers CSS list styling and dynamic, JavaScript-driven lists in depth.

Want to go beyond the notes?

Join Coding Hubs School of AI's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →