Computer Science Grade 6 20 min

Creating Lists: The `<ul>`, `<ol>`, and `<li>` Tags

Build unordered and ordered lists to organize information on your webpage.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Define the purpose of the `&lt;ul&gt;`, `&lt;ol&gt;`, and `&lt;li&gt;` HTML tags. Differentiate between an ordered list (`&lt;ol&gt;`) and an unordered list (`&lt;ul&gt;`). Construct a valid HTML unordered list with at least three list items. Construct a valid HTML ordered list with at least three list items. Explain why `&lt;li&gt;` tags must always be placed inside either a `&lt;ul&gt;` or `&lt;ol&gt;` tag. Create a nested list by placing one list inside a list item (`&lt;li&gt;`) of another list. Have you ever made a list of your favorite video games or the steps to beat a level? 🎮 Let&#039;s learn how to make those same lists on a real website! In this lesson, you&#039;ll discover how to organize information on a webpage using three special HTML tag...
2

Key Concepts & Vocabulary

TermDefinitionExample Unordered List: `&lt;ul&gt;`A list where the order of the items does not matter. It uses bullet points by default.A shopping list for a party: `&lt;ul&gt;&lt;li&gt;Chips&lt;/li&gt;&lt;li&gt;Soda&lt;/li&gt;&lt;li&gt;Balloons&lt;/li&gt;&lt;/ul&gt;` Ordered List: `&lt;ol&gt;`A list where the order of the items is important. It uses numbers by default.Steps to log in: `&lt;ol&gt;&lt;li&gt;Enter username&lt;/li&gt;&lt;li&gt;Enter password&lt;/li&gt;&lt;li&gt;Click &#039;Submit&#039;&lt;/li&gt;&lt;/ol&gt;` List Item: `&lt;li&gt;`A tag that represents a single item within either an ordered (`&lt;ol&gt;`) or unordered (`&lt;ul&gt;`) list.In a list of pets, `&lt;li&gt;Dog&lt;/li&gt;` would be one list item. HTML TagA special keyword surrounded by angle brackets, like `&lt;bod...
3

Core Syntax & Patterns

The Container Rule `&lt;li&gt;` tags MUST go inside a `&lt;ul&gt;` or `&lt;ol&gt;` tag. The `&lt;ul&gt;` and `&lt;ol&gt;` tags act like containers or boxes for your list items. You can&#039;t have a list item just floating by itself; it needs its container to tell the browser it&#039;s part of a list. The Order Rule Use `&lt;ol&gt;` for steps. Use `&lt;ul&gt;` for items. Choose your list container based on whether the order is important. If you are listing steps in a process (1, 2, 3...), use an Ordered List (`&lt;ol&gt;`). If you are just listing a group of things (like your favorite foods), use an Unordered List (`&lt;ul&gt;`). The Paired Tags Rule Every opening tag (`&lt;ul&gt;`, `&lt;ol&gt;`, `&lt;li&gt;`) needs a closing tag (`&lt;/ul&gt;`, `&lt;/ol&gt;`, `&lt;/li...

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
You want to create a list of planets where the main list is numbered, and a sub-list for Mars's moons is bulleted. Which structure is correct?
A.<ol><li>Mars<ul><li>Phobos</li><li>Deimos</li></ul></li></ol>
B.<ol><li>Mars</li></ol><ul><li>Phobos</li><li>Deimos</li></ul>
C.<ul><li>Mars<ol><li>Phobos</li><li>Deimos</li></ol></li></ul>
D.<ol><li>Mars</li><ul><li>Phobos</li><li>Deimos</li></ul></ol>
Challenging
A list on a webpage is supposed to be numbered A, B, C, but it's showing up as a, b, c. What is the MOST LIKELY error in the code?
A.The programmer used `<ol type="a">` instead of `<ol type="A">`.
B.The programmer used `<ul>` instead of `<ol>`.
C.The programmer forgot the `type` attribute completely.
D.The computer's keyboard had caps lock off.
Challenging
A programmer wants a numbered list to start at 'D' and continue to 'E', 'F', etc. Which code accomplishes this?
A.<ol type="A" start="4"><li>Item D</li></ol>
B.<ol type="D"><li>Item D</li></ol>
C.<ol type="letter" start="D"><li>Item D</li></ol>
D.<ol><li>D. Item D</li></ol>

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Advanced Topics

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.