Project: Luigi's Pizzeria - Adding CSS to the Contact Page

Requirements


Instructions

  1. In the "contacts.html" file, add a "link" to the "styles.css" file after the title tags:
<!-- Link to styles.css -->
<link rel="stylesheet" href="./css/styles.css">
  1. Save.
  2. If "Live Server" is not already running, right-click anywhere in the editor and select "Open with Live Server" from the context menu.
  3. Move the h1 and unordered list elements inside a new div tag that has a class of "navbar" so that it looks like this:
<!-- Wrap Navigation List in a DIV -->
<div class="navbar">
  <h1>Luigi's Pizzeria</h1>
  <ul>
    <li><a href="./index.html">Home</a></li>
    <li><a href="./pizzas.html">Our Pizzas</a></li>
    <li><a href="./prices.html">Prices</a></li>
    <li><a href="./contact.html">Contact</a></li>
  </ul>
</div>
  1. Save.
  2. Remove the background image by commenting out the following line of the HTML (we will be re-adding it via CSS later):
<!-- <img src="./images/background.jpg" alt="background image">
<br> -->
  1. Save.
  2. Create a new div with a class of "main" under the commented out img tag:
<div class="main">

</div>
  1. Save.
  2. Inside the div with a class of "main", create another div with a class of "main-content":
<div class="main-content">

</div>
  1. Save.
  2. Move the h2, h3, p tags, and form inside the div with a class of "main-content" so that it looks like the following:
<div class="main-content">
  <h2>Contact Us</h2>
  <br>
  <h3>Restaurant Location</h3>
  <p>100 Main St.</p>
  <p>Boston, MA 02818</p>
  <br>
  <br>
  <form action="" method="">
    <!-- Name -->
    <label for="name">Name</label>
    <input type="text" name="name" id="name">
    <br>
    <br>
    <!-- Email -->
    <label for="email">Email</label>
    <input type="email" name="email" id="email">
    <!-- Survey question on Pizza Enjoyment -->
    <p>Did you enjoy your pizza?</p>
    <input type="radio" name="enjoy" id="enjoy" value="yes">Yes
    <input type="radio" name="enjoy" id="enjoy" value="no">No
    <input type="radio" name="enjoy" id="enjoy" value="na">N/A
    <br>
    <br>
    <!-- Survey question about pizzas tried -->
    <p>Which pizzas have you tried?</p>
    <input type="checkbox" name="pizzas" id="pizzas" value="cheese">Cheese
    <input type="checkbox" name="pizzas" id="pizzas" value="mushroom">Mushroom
    <input type="checkbox" name="pizzas" id="pizzas" value="pepperoni">Pepperoni
    <br>
    <br>
    <p>Comments</p>
    <textarea name="comments" id="comments" cols="50" rows="5"></textarea>
    <br>
    <br>
    <input type="submit" value="submit">
  </form>
</div>
  1. Save.
  2. Add a div with a class of "footer" after the opening and closing tags of the div with class of "main":
<!-- Footer -->
<div class="footer">
</div>  
  1. Save.
  2. Move the copyright paragraph inside the div with class of "footer" so that it looks like the following:
<!-- Footer -->
<div class="footer">
  <p>&copy; 2023 All rights reserved.</p>
</div> 
  1. Save.
  2. In the "styles.css" file, add the following to style the submit button:
/* Submit button */
input[type=submit] {
  background-color: var(--primaryColor);
  padding: 12px 25px;
  color: var(--primaryWhite);
}
  1. Save.
  2. In the browser, you should see the following:

  3. index.html page

Code Walkthrough and Explanation

For the "Contact" page, all requirements were met. The navigation bar is dynamic and will look slightly different when the browser is resized. The feedback form is formatted and centered on the page. The submit button stands out. The footer is clear and centered at the bottom of the page.

Congratulations on completing the HTML and CSS portions of the "pizzeria" project! It's a fantastic achievement and a testament to your hard work and dedication. Building a responsive webpage that looks great on all devices is no easy feat, but you have done it with finesse. I hope you have learned a lot about HTML and CSS along the way, and I hope you continue to hone your skills as a software developer. You should be proud of what you have accomplished and celebrate this milestone. Well done!


Video and Code References


Questions? Subscribe and ask in the video comments:


GitHub and Other References