Creating Lists in HTML
Creating Lists in HTML
Objective:
Understand how to use ordered (<ol>) and unordered (<ul>) lists in HTML.
Instructions:
Create an unordered list with at least 3 items. The items can be anything you like (e.g., your favorite
animals, foods, hobbies, etc.). Use the <ul> tag for the unordered list and <li> tags for the list items.
Solution:
<ul>
<li>Pizza</li>
<li>Ice Cream</li>
<li>Sandwiches</li>
</ul>
Instructions:
Create an ordered list that shows 3 steps for something simple, like how to make a sandwich. Use the <ol>
tag for the ordered list and <li> tags for each step.
Solution:
<ol>
<li>Take two slices of bread</li>
<li>Spread peanut butter and jelly</li>
<li>Put the slices together and cut the sandwich</li>
</ol>
Instructions:
Combine both types of lists. Create a webpage that has a heading and then lists your 3 favorite foods using
an unordered list, followed by 3 steps to make one of those foods using an ordered list.
Solution:
<h3>Favorite Foods:</h3>
<ul>
<li>Pizza</li>
<li>Ice Cream</li>
<li>Sandwiches</li>
</ul>
<h3>How to Make a Sandwich:</h3>
<ol>
<li>Take two slices of bread</li>
<li>Spread peanut butter and jelly</li>
<li>Put the slices together and cut the sandwich</li>
</ol>
<!DOCTYPE html>
<html>
<head>
<title>My Favorite Foods and Sandwich Recipe</title>
</head>
<body>
<h1>Welcome to My Food List</h1>
<h3>Favorite Foods:</h3>
<ul>
<li>Pizza</li>
<li>Ice Cream</li>
<li>Sandwiches</li>
</ul>