In this activity, use HTML and CSS to create your own website!
Here is a rough outline of the activity as a whole:
| Item | Time |
|---|---|
| Introduction Slides | 10m |
| Code-Along | 30m |
| Site Sharing | 5m |
| Blooket | 10m |
| Conclusion | 5m |
Here is a rough outline of the activity as a whole:
| Item | Time |
|---|---|
| Introduction Slides | 10m |
| Code-Along | 40m |
| Additional Topics | 10m |
| Site Sharing | 10m |
| Blooket | 15m |
| Conclusion | 5m |
A few different concepts will be used during this activity:
Click here to view the Google Slides presentation that covers these concepts in more detail.
To get started, follow the steps below.
Now you have your own copy of a website to start editing!
Make sure the index.html file is selected on the left to view the HTML code. Notice how the code in the HTML creates the text on the website. Everything in HTML goes between tags, which tell the website what type of element to display.
The first thing to do is update the header text with your name! For example, if my name were Sokka, I could change the header so that it said Sokka’s Website.
Update the code in the HTML section, between the <h1> and </h1> tags. It should look something like this:
<h1>Sokka's Website</h1>
When you make a change, the preview should update automatically. If you see your name - that’s it! You’re officially a web developer!
Now it’s time to add a totally new element. The paragraph element is used to display normal text on a webpage. Its tags are <p> and </p>, with text content between.
<h1></h1><p> opening tag on the new line</p> to close the paragraph elementThe code should look something like this:
<p>Hi, I'm me. Welcome to my website!</p>
Next, it’s time to add some information about yourself. Think of some hobbies or activities you enjoy, and then follow the instructions to list them on your website!
<h2></h2> saying “My Hobbies” beneath the <p></p> element
h1<ul> opening tag, and make a new indented line
ul element will be? An unordered list!<ul>, add an <li></li> with one of your hobbies as the content
li element will be? A list item!li element on the next line</ul> to complete the elementThe code should look something like this:
<h2>My Hobbies</h2>
<ul>
<li>Reading</li>
<li>Writing</li>
<li>Petting Cats</li>
</ul>
This is looking rad, but what’s missing? Almost every website has at least one image, and yours can too!
The first thing to do is find an image. Images on websites have URLs which tell the browser where to look for them. Follow the instructions below to find the URL (or address) of an image, and copy it.
Now, the image address is stored on the clipboard. It will be possible to paste it into your website after adding some HTML.
Now that you have the image, it’s time to add it to your website.
</ul><h2> saying “A Cool Image”<img >img, before the >, type in src=""The code should look something like this:
<h2>A Cool Image</h2>
<img src="https://images.unsplash.com/photo-1482066490729-6f26115b60dc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80">
Now the content of the page is looking pretty good, but it’s not very stylish. One way to make the website look more fun and exciting is to use CSS! HTML is like the skeleton of a webpage, just the structure, and CSS is like the clothes that it wears, giving it style.
On the left side of the page, open the style.css file by clicking on it.
Take a look at the code so far. Try to figure out how to change the background color from white to another color, like pink!
The code should look something like this:
* {
background: pink;
}
CSS can change almost anything on a website. For this activity, update the text color, size, and font! All changes should take place in the style.css file.
Follow these instructions to change the text color on your website.
background color is set})color, followed by a colon (:)red) followed by a semi-colon (;)Run the code, and verify that the text color changes!
Note that every CSS property follows the same structure: property name, colon, property value, semi-colon.
Next, update the font and size of the text by following the instructions below.
color line (still above })font-family to a value of consolas
}font-size to a value of 18px
px means? Pixels!Run the code, and verify that the text changes font and size! Feel free to try changing the numbers or the font to see what works.
The code should look something like this:
* {
background: pink;
color: red;
font-family: consolas;
font-size: 18px;
}
Sometimes, images from online are way too big. It is possible to resize them using CSS!
Add this code to the style.css file (at the bottom):
img {
height: 200px;
}
That should resize the image to a more appropriate height. Feel free to try changing the number to see what works.
Some basic colors are built into the web (like pink and red), but it is also possible to use custom colors! Each color can be represented as a hexidecimal color code, which is a hashtag (#) followed by six alphanumeric characters. The easiest way to find a specific color is to use a color picker, like Google’s color picker! Follow the steps below to update the colors on the website.

The CSS code should look something like this:
* {
background: #ffbdbd;
color: #bf3636;
font-family: consolas;
font-size: 18px;
}
Hopefully your website is looking good by now! It should look something like this:

Congratulations, you’ve successfully built your own website!
To share your website, just copy the URL at the top of the preview! It is automatically published online, so anyone with a link can see it. Be careful though - if you don’t have an account, the website will be deleted within five days.
You can write your URL on one of the sheets that’s passed around - that way you can retain access to it! You can also share your live URL with your instructor, and they can show it on the project for all to see.
If there is time remaining, there are a lot of additional updates to be made! If you go to bit.ly/coding-activities, you can click the Building a Website: Additional Topics link to discover more of the possibilities.
Click here for the Blooket quiz.
Thank you so much for participating in this activity. In this short time, you’ve been able to accomplish a lot! If you’d like to continue your web development journey, there’s a lot more you can do.