Pizza Website: Follow-Along Activity
Alfredo's Pizza Cafe has some great pizza, but unfortunately their technological prowess is not so great. They need your help to create their website! They want to provide some information about their restaurants, along with an order form so customers can order pies online. Start from this empty Glitch, and then follow the instructions below.
Setup
- Open up the index.html file
- Add the
html
tags (opening and closing) - Add the
body
tags within thehtml
tags
Adding the Basics
- Add an
h1
header that says "Alfredo's Pizza Cafe" within thebody
- Under the
h1
, add animg
of the pizza (set thesrc
attribute to "https://styles.redditmedia.com/t5_21ulkr/styles/profileIcon_owuf7qzyhuk61.jpg") - Under the
img
, add ap
that says "WE'RE NOT FINE DINING; WE'RE JUST FINE FOOD!"- Note that this is the actual slogan of the actual Alfredo's Pizza Cafe
- Open your webpage in a browser and make sure it appears as expected!
At the end of this section, your code should look like this:
<html>
<body>
<h1>Alfredo's Pizza Cafe</h1>
<img src="https://styles.redditmedia.com/t5_21ulkr/styles/profileIcon_owuf7qzyhuk61.jpg">
<p>WE'RE NOT FINE DINING; WE'RE JUST FINE FOOD!</p>
</body>
</html>
Adding a List of Locations
- Add an
h2
header under thep
that says "Locations" - Under the
h2
, add a newul
(unordered list) - Within the
ul
, add some locations withinli
elements- Note that the
li
elements are children of theul
element
- Note that the
- Open your webpage in a browser and make sure it appears as expected!
At the end of this section, your code should look like this:
<html>
<body>
<h1>Alfredo's Pizza Cafe</h1>
<img src="https://styles.redditmedia.com/t5_21ulkr/styles/profileIcon_owuf7qzyhuk61.jpg">
<p>WE'RE NOT FINE DINING; WE'RE JUST FINE FOOD!</p>
<h2>Locations</h2>
<ul>
<li>Scranton, PA</li>
<li>Albany, NY</li>
<li>Utica, NY</li>
</ul>
</body>
</html>
Adding the Order Form
The website has information now, but we still need to add in an order form! Start by adding an h2
header that says "Order Form" underneath the locations list. Then, follow the steps below to add some fields to the form.
Pizza Size
For pizza size, the user should be able to select from a dropdown of available sizes.
- Under the "Order Form"
h2
, add anh3
that says "Pizza Size"- This will serve as a label for our field
- Create a
select
element under the "Pizza Size"h3
- Within the
select
, add some pizza sizes withinoption
elements- Note that the
option
elements are children of theselect
element
- Note that the
- Open your webpage in a browser and make sure it appears as expected!
Your code for this section should look like this:
<h3>Pizza Size</h3>
<select>
<option>Small</option>
<option>Medium</option>
<option>Large</option>
</select>
Toppings
For toppings, the user should be able to select whichever combination they choose using checkboxes.
- Under the Pizza Size
select
, add anh3
that says "Toppings" - Under the
h3
, add a newp
paragraph - Inside the
p
, add aninput
element with thetype
attribute set to "checkbox" - Next to the
input
element (still within thep
), add the text "Pepperoni" - Repeat the above steps to add three additional topping
p
elements, each with a checkbox and text - Open your webpage in a browser and make sure it appears as expected!
Your code for this section should look like this:
<h3>Toppings</h3>
<p><input type="checkbox"> Pepperoni</p>
<p><input type="checkbox"> Sausage</p>
<p><input type="checkbox"> Mushrooms</p>
<p><input type="checkbox"> Black Olives</p>
Name, Address, and Submit
Lastly, the user should be able to enter their name and address so Alfredo knows where to send the pizza! They will also need a submit button.
- Under the toppings, add an
h3
that says "Name" - Under the Name
h3
, add a newinput
with thetype
attribute set to "text" - Under the name
input
, add anh3
that says "Address" - Under the Address
h3
, add a newtextarea
element - Under the address
textarea
, add a newp
element - Within the
p
element, add a newinput
element with thetype
attribute set to "submit" - Open your webpage in a browser and make sure it appears as expected!
Your code for this section should look like this:
<h3>Name</h3>
<input type="text">
<h3>Address</h3>
<textarea></textarea>
<p><input type="submit"></p>
That's it! Your website has some information about the website, and a form the user can submit.
Final HTML
<html>
<body>
<h1>Alfredo's Pizza Cafe</h1>
<img src="https://styles.redditmedia.com/t5_21ulkr/styles/profileIcon_owuf7qzyhuk61.jpg">
<p>WE'RE NOT FINE DINING; WE'RE JUST FINE FOOD!</p>
<h2>Locations</h2>
<ul>
<li>Scranton, PA</li>
<li>Albany, NY</li>
<li>Utica, NY</li>
</ul>
<h2>Order Form</h2>
<h3>Pizza Size</h3>
<select>
<option>Small</option>
<option>Medium</option>
<option>Large</option>
</select>
<h3>Toppings</h3>
<p><input type="checkbox"> Pepperoni</p>
<p><input type="checkbox"> Sausage</p>
<p><input type="checkbox"> Mushrooms</p>
<p><input type="checkbox"> Black Olives</p>
<h3>Name</h3>
<input type="text">
<h3>Address</h3>
<textarea></textarea>
<p><input type="submit"></p>
</body>
</html>