You were at the zoo and accidentally let the animals loose! You're on the run and come across a brick wall with three suspicious doors! Which door will you choose? Where will it lead?!
Use HTML Links, Images, Headers and correctly specify the file paths to lead us to a new place at each door.
To complete this project, students should have the following:
- Basic understanding of HTML structures and attributes.
- Basic understanding of CSS (Selectors, Basic Properties like Width and Height)
HTML | Description |
---|---|
HTML | H yper T ext M arkup L anguage used to create the structure of web pages. |
element | An element is an individual part, or a building block, of a web page. |
attribute | A modifier of an element. |
div | A container element. |
img | An image element. |
a | A link element. |
href | An attribute used to specify the link destination. |
id | A unique attribute on an element used for targeting in CSS. |
class | An attribute that can be applied to multiple elements used for targeting in CSS. |
File Paths | Description |
---|---|
File Path | Describes the location of a file in a web site's folder structure. |
Absolute File Path | Full URL to an Internet file. Ex. https://www.w3schools.com/images/picture.jpg |
Relative File Path | Path to a file relative to the current page. Ex. assets/example.png |
Relative File Paths | Description |
---|---|
images/picture.jpg | Goes into the images folder, then points to the picture.jpg. |
../images/picture.jpg | Goes outside of the current folder, then goes into the images folder, then points to the picture.jpg. |
To complete Part I, fulfill the following requirements:
- Set up your project file structure through the command line.
- Create the following:
- HTML file
- CSS folder with a CSS file
- Folder called "rooms"
- Link all of your files correctly.
Make sure you have the assets from the repository as well.
To complete Part II, fulfill the following requirements:
- Create a
div
with anid
of "container".
-
Inside of this div, create the following:
- A link element Do you remember the tag name for a link element? Look at the table above! Inside of this link element, create an image element with
id
of "door1" andclass
of "door". - A link element. Inside of this link element, create an image element with
id
of "door2" andclass
of "door". - A link element. Inside of this link element, create an image element with
id
of "door3" andclass
of "door".
Specify the right
src
for the image. Find the door image in the assets folder. Create the path to specify the door image and place that in the img src! - A link element Do you remember the tag name for a link element? Look at the table above! Inside of this link element, create an image element with
- Inside of the rooms folder, create 3 HTML files as follows:
- dungeon.html
- outer-space.html
- the-future.html
- Now go back to the index.html file. When we click on one of the doors we want to be linked to another HTML file! How do we do that? We need to use a relative file path to specify the location of our HTML file! How do we go from where we currently are in the index.html to the dungeon, outer-space, and the-future HTML files?
- In the
href
attribute of the 1st link element, specify the path to the dungeon.html file. - In the
href
attribute of the 2nd link element, specify the path to the outer-space.html file. - In the
href
attribute of the 3rd link element, specify the path to the the-future.html file.
- Target the
id
of "container".
- Set the
width
tocalc(100vw)
. This will get the full width of the page. - Set the
height
tocalc(100vh)
. This will get the full height of the page. - Set the background-image to the brick wall image. Hint: https://www.w3schools.com/cssref/pr_background-image.asp Remember, we want the brick wall image. How do we specify the path of that?
- Target the
class
of "door".
- Set the
width
to200px
. - Set the
height
to400px
.
- Target the
id
of "door1".
- Set the
position
tofixed
. This allows us to specify exactly where we want the image to stay on the page. - Place the door at the very bottom of the page and some pixels away from the left side of the page. Make sure the doors do not overlap. Use the properties
bottom
,left
,top
, and/orright
and see which works best. Test out different values! Hint: https://www.w3schools.com/cssref/pr_class_position.asp
Do this for all 3 doors!
To complete Part IV, fulfill the following requirements:
- Go into your CSS Folder.
- Create 3 CSS files as follows:
- dungeon.css
- outer-space.css
- the-future.css
To complete Part V, fulfill the following requirements:
- Go into your dungeon.html file.
- Link the corresponding dungeon.css file. Hint: How do you go from dungeon.html to dungeon.css?
- In this HTML file, create a
div
with anid
of "container".
- Inside of this div, create an
h1
with anid
of "text". Inside of thish1
, type "BEWARE OF THE DRAGON". - Create a link element with an
id
of "home". In thehref
attribute, specify the location of the index.html file. Hint: How do you go from dungeon.html to index.html?
To complete Part VI, fulfill the following requirements:
- Go into your dungeon.css file.
- Target the
id
of "container".
- Set the
width
tocalc(100vw)
. This will specify the full width of the page. - Set the
height
tocalc(100vh)
. This will specify the full height of the page. - Set the background-image to the dragon.gif. Remember how you set the background image in the earlier part?
- Target the
id
of "text".
- Set the background color to white! How do you do that? https://www.w3schools.com/cssref/pr_background-color.asp
- Target the
id
of "home".
- Set the background color to white!
To complete Part VII, fulfill the following requirements:
- Go into your outer-space.html file.
- Link the corresponding outer-space.css file. Hint: How do you go from outer-space.html to outer-space.css?
- In this HTML file, create a
div
with anid
of "container".
- Inside of this div, create an
h1
with anid
of "text". Inside of thish1
, type "THE ALIENS ARE COMING". - Create a link element with an
id
of "home". In thehref
attribute, specify the location of the index.html file. Hint: How do you go from outer-space.html to index.html?
To complete Part VIII, fulfill the following requirements:
- Go into your outer-space.css file.
- Target the
id
of "container".
- Set the
width
tocalc(100vw)
. This will specify the full width of the page. - Set the
height
tocalc(100vh)
. This will specify the full height of the page. - Set the background-image to the alien.gif. Remember how you set the background image in the earlier part?
- Target the
id
of "text".
- Set the background color to white! How do you do that? https://www.w3schools.com/cssref/pr_background-color.asp
- Target the
id
of "home".
- Set the background color to white!
To complete Part IX, fulfill the following requirements:
- Go into your the-future.html file.
- Link the corresponding the-future.css file. Hint: How do you go from the-future.html to the-future.css?
- In this HTML file, create a
div
with anid
of "container".
- Inside of this div, create an
h1
with anid
of "text". Inside of thish1
, type "THIS IS THE FUTURE!!". - Create a link element with an
id
of "home". In thehref
attribute, specify the location of the index.html file. Hint: How do you go from the-future.html to index.html?
To complete Part X, fulfill the following requirements:
- Go into your the-future.css file.
- Target the
id
of "container".
- Set the
width
tocalc(100vw)
. This will specify the full width of the page. - Set the
height
tocalc(100vh)
. This will specify the full height of the page. - Set the background-image to future.gif. Remember how you set the background image in the earlier part?
- Target the
id
of "text".
- Set the background color to white! How do you do that? https://www.w3schools.com/cssref/pr_background-color.asp
- Target the
id
of "home".
- Set the background color to white!
Awesome Job! Check if it works and takes you to these places when you click on the doors!
- Create another door in the index.html file that will take you to a place of your choosing!
- In this new place, create ANOTHER door that will take you to ANOTHER new place!