Practice for Quiz 1
To study for Quiz 1, please complete the practice quiz by downloading the starter files and following the instructions (below). If you have questions, please ask during class time or in office hours.
Part 1: Setup
You are going to build the webpage pictured below:
Inside of the practice-quiz01
folder, create a brand new HTML file called index.html
that is a direct child of the practice-quiz01
folder. If you did it correctly, your file structure should look like this:
practice-quix01
├── images
│ ├── landscape1_300x200.jpg
│ ├── landscape2_300x200.jpg
│ └── landscape3_300x200.jpg
├── index.html
└── pages
├── about.html
└── gallery.html
Edit index.html
file by adding an HTML “skeleton” with the following tags:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
Part 2: HTML Tasks
Edit the index.html
pages as follows:
2.1. Metadata
- Add a
title
tag inside of thehead
tag, with the display text of “Practice Quiz 1: Your Name.”
2.2. Header Section
- Add a
header
tag inside thebody
tag (don’t get the head and the header tag confused). - Inside the
header
tag, create anh1
tag that displays the text “Practice Quiz 1: Your Name.”
2.3. Navigation
- Below the
header
tag, create a navigation section using thenav
tag. - Inside of the
nav
tag, create three hyperlinks:- One that links to
gallery.html
(in the pages folder) with the display text of “Photo Gallery”. Use a relative path. - One that links to
about.html
with the display text of “About Us”. Also use a relative path. - One that links to Instagram’s home page, the display text of “Instagram”. Use an absolute path.
- One that links to
Note: you may not move the gallery.html or about.html files outside of the pages
folder.
2.4. Main Section
- Below the
nav
tag, create amain
tag. - Inside the
main
tag, create a section that has an id of “images”. - Inside of the section you just made, create 3
img
tags that display the three images in theimages
folder, using relative paths.- Don’t forget to use the
alt
attribute to give each image a description (for people who use a screen reader).
- Don’t forget to use the
2.5. Footer
Create a footer section below your main
section using the footer
tag. Within the footer, create a paragraph tag that says “Copyright Your Name, 2023.”
Part 3: Styling tasks
Create a CSS file called styles.css
that is a direct child of the practice-quiz01
folder. If you did it correctly, your file structure should look like this:
practice-quix01
├── images
│ ├── landscape1_300x200.jpg
│ ├── landscape2_300x200.jpg
│ └── landscape3_300x200.jpg
├── index.html
├── pages
│ ├── about.html
│ └── gallery.html
└── styles.css
Edit your index.html
file by adding a link to your stylesheet. Then, complete the following tasks within styles.css
:
3.1. Body
Create a rule for the body
element that sets the background color to a light gray (#F0F4EF
) and the margin to 0px
.
3.2. Header
Create some style rules for the header
element (and any relevant child elements) to:
- Set the background color to
#b4cded
- Center the text horizontally
- Set the font family to
Impact
- Set the height to
100px
- Give the container
30px
of padding
3.3 Navigation
Create some style rules for the nav
element (and any relevant child elements) to:
- Center-align the hyperlinks (text-align: center)
- Turn the background color to
black
- Add
20px
of padding
3.4. Navigation Links
Create some style rules for all of the a
tags inside of the nav
element:
- Set the link color to white.
- Turn off the underlines (text-decoration)
- Make the text bold (font-weight)
- Hint: anchor (a) tags have multiple pseudo-classes that you’ll want to set the style for (a, a:link, a:hover, a:visited, a:active). See this site for more information.
3.5. Main
- Create some style rules for the
main
tag:- Add some padding
- center align the images (text-align: center)
- Create a style rule for the
img
tag that adds a left margin of 30px to each image.
3.6. Footer
Create some style rules to set the footer’s background color to #344966
, and the footer’s text color to white.
What to Submit (if this were a real quiz)
If this were the real quiz, you would commit and push your changes (like we’ve been doing in class). Then, you would paste two links into the Quiz 1 section;
- A link to your code repository (e.g., https://github.com/vanwars/csci185-coursework)
- A link to your homepage (e.g., https://vanwars.github.io/csci185-coursework)