LISTS9 min20 XP

Lists ul ol dl

Learn Lists ul ol dl with syntax-highlighted examples, live output, and Shiv AI.

HTML Lists: ul, ol, and dl

HTML has three list types. Lists are powerful for SEO — Google often extracts ordered lists directly into Featured Snippets at the very top of search results.

Unordered List — Bullet Points

Use <ul> when order doesn't matter:

Example — Unordered List
<ul>
  <li>HTML — structure of web pages</li>
  <li>CSS — styles and layout</li>
  <li>JavaScript — interactivity</li>
</ul>
  • HTML — structure of web pages
  • CSS — styles and layout
  • JavaScript — interactivity

Ordered List — Numbered Steps

Use <ol> when order matters. Google loves these for Featured Snippets:

Example — Ordered List
<ol>
  <li>Learn HTML structure</li>
  <li>Add CSS styling</li>
  <li>Add JavaScript behavior</li>
  <li>Deploy to the web</li>
</ol>
  1. Learn HTML structure
  2. Add CSS styling
  3. Add JavaScript behavior
  4. Deploy to the web
Google extracts ordered lists for "How to" Featured Snippets — this puts you at position zero!

Description List — Terms and Definitions

Example — Description List
<dl>
  <dt>HTML</dt>
  <dd>Structure of web pages</dd>
  <dt>CSS</dt>
  <dd>Controls how pages look</dd>
</dl>
HTML
Structure of web pages
CSS
Controls how pages look

Nested List

Example — Nested List inside li
<ul>
  <li>Frontend
    <ul>
      <li>HTML</li>
      <li>CSS</li>
    </ul>
  </li>
</ul>
  • Frontend
    • HTML
    • CSS
The nested ul goes INSIDE the li element, not after it.
Valid Children Only

Only <li> elements are valid direct children of ul and ol. Never put p, div, or span directly inside a list — always wrap in li first.

Lists Before the Web

HTML list tags were modeled after academic typesetting conventions. The dl tag was designed for computer science glossaries where defining technical terms precisely was fundamental to academic writing.

CIWeb HTML Course • 22 Lessons • Free

Explain with Analogies

Shiv AI explains this lesson using only real-life analogies. No code at all.

Click the Explain tab to generate analogies automatically.
index.html
Live Preview
Start coding - Shiv AI monitors automatically

Which list type creates numbered items good for Google Featured Snippets?

Explanationol (ordered list) creates numbered items. Google uses numbered ol lists for "How To" Featured Snippets at position zero.
Build Challenge
All Three Lists
Create all three HTML list types with at least one nested list inside a li.
Requirements (5 to pass)
ul with li
ol ordered
dl with dt dd
nested list
four or more li
solution.html
Preview
Community Wall
Lesson 7
0/500
0/20 lines
as
Recent Posts
Lesson 7 only

Support CIWeb + Get +50 AI Messages

Just Rs.11 gives you 50 extra Shiv AI messages and keeps CIWeb free for everyone.

AI
Shiv AI
Online