<> HTML Foundations

Understand semantic HTML, document structure, forms, accessibility and SEO-ready markup.

Lessons

Sign in to save progress
1 HTML Tutorial 2 HTML HOME 3 HTML Introduction 4 HTML Editors 5 HTML Basic 6 HTML Elements 7 HTML Attributes 8 HTML Headings 9 HTML Paragraphs 10 HTML Styles 11 HTML Formatting 12 HTML Quotations 13 HTML Comments 14 HTML Colors 15 HTML CSS 16 HTML Links 17 HTML Images 18 HTML Favicon 19 HTML Page Title 20 HTML Tables 21 HTML Lists 22 HTML Block & Inline 23 HTML Div 24 HTML Classes 25 HTML Id 26 HTML Buttons 27 HTML Iframes 28 HTML JavaScript 29 HTML File Paths 30 HTML Head 31 HTML Layout 32 HTML Responsive 33 HTML Computercode 34 HTML Semantics 35 HTML Style Guide 36 HTML Entities 37 HTML Symbols 38 HTML Emojis 39 HTML Charsets 40 HTML URL Encode 41 HTML vs. XHTML 42 HTML Forms 43 HTML Form Attributes 44 HTML Form Elements 45 HTML Input Types 46 HTML Input Attributes 47 Input Form Attributes 48 HTML Graphics 49 HTML Canvas 50 HTML SVG 51 HTML Media 52 HTML Video 53 HTML Audio 54 HTML Plug-ins 55 HTML YouTube 56 HTML Web APIs 57 HTML Geolocation 58 HTML Drag and Drop 59 HTML Web Storage 60 HTML Web Workers 61 HTML SSE 62 HTML Certificate 63 HTML Examples 64 HTML Editor 65 HTML Quiz 66 HTML Exercises 67 HTML Challenges 68 HTML Website 69 HTML Syllabus 70 HTML Study Plan 71 HTML Interview Prep 72 HTML Bootcamp 73 HTML Summary 74 HTML Accessibility 75 HTML References 76 HTML Tag List 77 HTML Attributes Reference 78 HTML Global Attributes 79 HTML Browser Support 80 HTML Events 81 HTML Colors Reference 82 HTML Canvas Reference 83 HTML Audio/Video 84 HTML Doctypes 85 HTML Character Sets 86 HTML URL Encode Reference 87 HTML Lang Codes 88 HTTP Messages 89 HTTP Methods 90 PX to EM Converter 91 Keyboard Shortcuts

HTML Lists

HTML Foundations Lesson 21 of 91 ~7 min read

Overview

HTML Lists is part of the complete HTML syllabus. This lesson explains the concept deeply, shows the exact tags or attributes to use, and gives you a runnable browser example for practice.

HTML Lists is about choosing markup that carries meaning before styling begins. Good HTML gives the page a reliable structure, makes the content easier to maintain, and gives browsers, search engines, forms, and assistive technologies the information they need.

Core Ideas

  • Use HTML Lists to improve the meaning of the document, not only the appearance.
  • Keep labels, headings, landmarks, and relationships explicit.
  • Prefer built-in browser behavior whenever it already solves the job.
  • Check that the page still makes sense when CSS and JavaScript are unavailable.

Step by Step

  1. Identify the content relationship that HTML Lists needs to express.
  2. Choose the native element, attribute, or browser API that matches that relationship.
  3. Add the smallest useful markup first, then add progressive enhancements.
  4. Validate the result with keyboard navigation, browser tools, and source inspection.

Beginner Explanation

HTML Lists helps you group related items. Lists make navigation, steps, menus, features, and checklists easier to scan.

Use an unordered list when order does not matter, an ordered list when sequence matters, and a description list for term-and-definition pairs.

A list is semantic. That means screen readers and search engines understand the items belong together.

Before You Start

  • Group the items for HTML Lists before choosing the list element.
  • Decide whether the order changes the meaning.
  • Keep each item as one clear thought so the list stays easy to scan.

Key Tags and Attributes

  • ul: unordered list when sequence does not matter.
  • ol: ordered list when sequence matters.
  • li: one item inside a list.
  • dl, dt, dd: description list for terms and definitions.

Plain-English Glossary

  • Unordered list: a list where sequence does not change the meaning.
  • Ordered list: a list where the order or steps matter.
  • Description list: a list of terms and their explanations.
  • List item: one entry inside a list.

What You Will Learn

  • Choose ul, ol, or dl based on the relationship between the items in HTML Lists.
  • Write list items that are parallel, short, and easy to scan.
  • Use lists for navigation, steps, features, checklists, menus, and glossary content.
  • Nest lists only when a child item truly belongs under a parent item.

Where You Use This in Real Projects

You use HTML Lists for menus, breadcrumbs, feature lists, onboarding steps, article outlines, product specs, and task checklists.

Lists help users scan a page quickly because the browser exposes the group and each item as related content.

When to Use This

  • Use HTML Lists when items belong together and should be announced as a group.
  • Use an ordered list when sequence matters and an unordered list when it does not.
  • Use headings and paragraphs instead when each item is a full independent section.

Browser and Accessibility Notes

  • Browsers expose list size and item order to assistive technology.
  • Removing bullets with CSS does not remove list meaning from the HTML.
  • Navigation lists should have a nav landmark or an aria-label when there are multiple nav areas.
  • Long lists are easier to use when grouped with headings.

Code Example

<h2>Frontend checklist</h2>
<ul>
  <li>Write semantic HTML</li>
  <li>Style with CSS</li>
  <li>Add JavaScript behavior</li>
</ul>

<ol>
  <li>Create the structure</li>
  <li>Test in the browser</li>
</ol>

Another Example

<nav aria-label="HTML topics">
  <ul>
    <li><a href="#elements">Elements</a></li>
    <li><a href="#attributes">Attributes</a></li>
    <li><a href="#forms">Forms</a></li>
  </ul>
</nav>

Example Explained

  • The nav element tells the browser this list is navigation.
  • The ul groups related links together.
  • Each li is one item in that group.
  • The link text is descriptive, so users know what they will open.

How to Read This Example

  1. Start by asking whether order matters in the HTML Lists example.
  2. If the sequence matters, read the ol as steps. If order does not matter, read the ul as a group of related items.
  3. Each li should contain one complete item. If an item has child items, nest another list inside that li.
  4. Check the list without CSS so you can see whether the structure is still clear.

Code Editor Example

Open a ready-made starter for this lesson in the live HTML, CSS, and JavaScript editor. You can change the code, then click Run to see the result immediately.

Open in Code Editor

Checklist

  • Use the most specific native element before reaching for a div.
  • Check the page with keyboard navigation and browser validation.
  • Keep the markup readable before adding CSS or JavaScript.

Common Mistakes

  • Using divs for everything and losing built-in semantics.
  • Adding JavaScript for behavior the browser already provides.
  • Forgetting labels, alt text, lang, viewport, or metadata that other tools rely on.

Do and Don't

  • Do: choose ol, ul, or dl based on the content relationship in HTML Lists.
  • Do: keep each list item short enough to scan.
  • Don't: use line breaks instead of list markup for related items.
  • Don't: nest lists so deeply that the page becomes hard to read.

Practice Challenge

Recreate the HTML Lists example in the code editor, then inspect the DOM and check that labels, links, and metadata still make sense without CSS.

Try These Changes

  • Change the text in the HTML Lists example and run it again.
  • Add one new related element, such as another paragraph, list item, table row, input, or link.
  • Add a class name and write a small CSS rule for it in the CSS tab.
  • Break one tag on purpose, run it, then fix it so you understand how browsers recover from mistakes.

Quick Check

  • Question: What is the main job of HTML Lists? Answer: To add meaning and structure to the page.
  • Question: Should HTML be readable without CSS? Answer: Yes, the structure should still make sense.
  • Question: What should you do after reading the example? Answer: Open it in the editor and change one thing.

Revision Questions

  • Does order matter in the HTML Lists example?
  • Would ul, ol, or dl describe the relationship best?
  • Can each item be understood by itself?
  • Would a heading make the list easier to understand?

Debugging Checks

  • Ask whether the item order matters; if yes, use ol instead of ul.
  • Make sure each li belongs directly inside the correct list.
  • Check nested lists for missing closing tags and confusing indentation.
  • Read the list without CSS and confirm the grouping still makes sense.

Mini Project

Create a learning checklist with one unordered list, one ordered list, and one nested list. Then explain why each list type fits its content.

Mastery Check

  • You can explain why the chosen HTML for HTML Lists is more meaningful than a generic div.
  • You can identify the keyboard and accessibility behavior provided by the browser.
  • You can extend the example without breaking validation.
Create a free account to save which lessons you've finished. Save my progress