SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10
Try this code live
Lesson 18 of 35

HTML Lists: ul, ol, dl & Nested Lists Explained

3 min read · Free · No login needed

Lists group related items together. HTML has three kinds: unordered lists (<ul>) with bullets, ordered lists (<ol>) with numbers, and description lists (<dl>) with terms and their meanings. Each item in the first two is an <li> element.

Diagram — see how it fits together
Diagram: unordered and ordered lists

Unordered lists — ul

Use <ul> when the order does not matter: a shopping list, a set of features, a navigation menu. The browser shows a bullet before each item by default.

Ordered lists — ol

Use <ol> when the order matters: steps in a recipe, the top 5 of anything, instructions. The browser numbers the items automatically — 1, 2, 3. You can change the numbering with the type attribute (type="A" gives A, B, C; type="i" gives i, ii, iii) and start from any number with start="5".

Description lists — dl

Use <dl> for name-value pairs: a glossary, a FAQ, or a list of terms. Each term is a <dt> and each description is a <dd>.

Nesting lists

A list can sit inside a list item. This is how multi-level menus are built: a <ul> inside an <li> of another <ul>. Just remember to close the inner list before closing the item that holds it.

Tip: Navigation menus on almost every website are just unordered lists styled with CSS. Learn lists well and you have learned the skeleton of every menu.

What lists are for

A list is a group of related items. HTML gives you three kinds: <ul> for items where the order does not matter (a shopping list), <ol> for items where the order does matter (recipe steps), and <dl> for a term and its definition (like a dictionary). Every item in a ul or ol is an <li>, and an li must always sit directly inside the list — never on its own.

Ordered list attributes

AttributeValueDescription
type1, A, a, I, iThe numbering style: 1, 2, 3 — A, B, C — a, b, c — I, II, III — i, ii, iii.
starta numberThe number the list starts from. start="5" begins at 5.
reversed—Counts backwards, from high to low.

Here is an ordered list that starts at 3 and counts with capital letters:

<ol type="A" start="3">
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
Note: A description list uses three tags together: <dl> for the whole list, <dt> for the term, and <dd> for the description. It is perfect for glossaries and FAQ pages.
Tip: You can change the bullet shape with CSS instead of an attribute — list-style-type: square; gives square bullets, and list-style-type: none; removes them completely, which is how navigation menus are built.

Common mistakes

  • Putting an <li> outside a <ul> or <ol> — list items only exist inside a list.
  • Using a list for a single item — one item is not a list, just use a paragraph.
  • Nesting a new list outside the <li> — a sub-list must go inside the li it belongs to.
  • Using <ul> for steps that must be done in order — that is what <ol> is for.

Example explained

  • <h2>Shopping List</h2> — a heading that splits the page into sections, so the reader knows what the first list is about.
  • <ul> — an unordered list. The order of shopping items does not matter, so the browser shows bullets instead of numbers.
  • <li>Milk</li> — one list item. Every item must sit directly inside the <ul>, never on its own.
  • <ol> — an ordered list. Tea-making steps must be done in order, so the browser numbers them 1, 2, 3 automatically.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Lists</title>
</head>
<body>

<h2>Shopping List</h2>
<ul>
<li>Milk</li>
<li>Bread</li>
<li>Eggs</li>
</ul>

<h2>Steps to Make Tea</h2>
<ol>
<li>Boil water.</li>
<li>Add tea leaves.</li>
<li>Pour and serve.</li>
</ol>

</body>
</html>

Output

Output — how it looks in the browser
Output of HTML Lists: ul, ol, dl & Nested Lists Explained

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. What are the three kinds of HTML lists?

ul with bullets when order does not matter, ol with numbers when order matters, and dl for terms and their meanings.

2. When should you use ol instead of ul?

Use ol for steps that must be done in order, such as recipe steps or instructions; the browser numbers them automatically.

3. How do you make a nested list?

Put a list inside an li of another list, and close the inner list before closing the item that holds it.

Why learn this yourself — and not just ask AI?

AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

AI & ML with Azure AI, AWS AI & Generative AI
₹10,000
View
AI Prompt Engineering Webinar 2026
View
Advanced Cyber Security Industrial Training
₹5,000
View
Browse all courses
HTML — Lessons
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →