HTML Lists
What Is It?
A list groups related items. Use numbers when the order matters and bullets when it does not.
What the Tags Mean
ul: a bullet list.ol: a numbered list.li: one list item.dl,dt,dd: a term and its explanation.
Example 1
Save each example as index.html and open it in your browser. Each code block is a complete page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Lists</title>
</head>
<body>
<ul>
<li>Paper</li>
<li>Pencil</li>
</ul>
</body>
</html>Browser preview
What you see: You see two items with bullet points.
Example 2: Another Use
Use an ordered list for steps in a recipe.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Lists</title>
</head>
<body>
<ol>
<li>Wash the fruit.</li>
<li>Cut it into pieces.</li>
</ol>
</body>
</html>Browser preview
Simple Tip
Put each item inside its own li tag.
Try It Yourself
Write a list of three things in your bag.