π― Unit 1 Activities
Table of Contents
π» ACTIVITY PROGRAM SETUP INSTRUCTIONS
- Go to the public template repository for our class: BWL-CS HTML/CSS/JS Template
- Click the button above the list of files then select
Create a new repository
- Specify the repository name:
CS1-Unit1-Activity#
Replace
#
with the specific activity number. - Click
Now you have your own personal copy of this starter code that you can always access under the
Your repositories
section of GitHub! π - Now on your repository, click and select the
Codespaces
tab - Click
Create Codespace on main
and wait for the environment to load, then youβre ready to code!
π When class ends, donβt forget to SAVE YOUR WORK! Codespaces are TEMPORARY editing environments, so you need to COMMIT changes properly in order to update the main repository for your program.
There are multiple steps to saving in GitHub Codespaces:
- Navigate to the
Source Control
menu on the LEFT sidebar - Click the button on the LEFT menu
- Type a brief commit message at the top of the file that opens, for example:
updated main.py
- Click the small
βοΈ
checkmark in the TOP RIGHT corner - Click the button on the LEFT menu
- Finally you can close your Codespace!
π ACTIVITY #1: Design an βAbout Meβ Page
In this activity, youβll build a short personal biography using only the HTML elements youβve learned so far. Your page should introduce who you are, highlight your interests, and include some fun or unique touches using links, images, and lists.
This activity will give you a chance to:
- Use semantic tags like headings, paragraphs, and lists
- Embed links and images
- Experiment with text emphasis (bold, italic)
- Explore absolute vs. relative URL paths
- Understand element nesting and indentation
PART A: Set Up Your Project
- Open a new Codespace.
- Open the
index.html
file. - Delete any existing code.
- Rebuild the HTML boilerplate from scratch!
Try from memory, but peek at the π1.2 Notes if needed.
- Set the
<title>
metadata of your page to something likeAbout Me - Katerina
(use your own name!)
PART B: Add a Hero Section
- Inside the
<body>
, add an<h1>
heading that says something like βWelcome to My Webpage!β - Add a short introductory
<p>
element with your name and a few fun facts. - Use
<strong>
to emphasize one fact and<em>
to add emphasis to another. - Nest your
<strong>
or<em>
elements inside the paragraph, and make sure everything is indented properly.
PART C: Add a Personal Image
- Download or select a personal (school-appropriate) image of yourself, a pet, or something you love.
- Upload the image to your project folder (use drag-and-drop or upload via the file explorer).
- Add an
<img>
tag to your page that displays the image. -
Be sure to include:
- a relative
src
path (like./images/me.jpg
) - an
alt
attribute that describes the image - a
width
andheight
attribute to scale it properly (try 200px wide to start)
- a relative
PART D: Add Some Links
- Create an
<h2>
section called βMy Linksβ. - Add at least two anchor (
<a>
) elements as absolute links to websites you like.
PART E: Make Lists of Favorites
- Create an
<h2>
heading titled βMy Favorite Thingsβ. - Add at least one ordered list (e.g. favorite movies, songs, books, classes, etc.).
- Add at least one unordered list (e.g. favorite snacks, hobbies, vacation spots).
- Make sure all
<li>
list items are nested properly inside a set of either<ol>
or<ul>
tags.
π ACTIVITY #2: Style an NYC Subway Schedule
In this activity, youβll build a subway schedule page and style it with CSS selectors, colors, fonts, and the box model.
We will practice the following skills:
- External CSS with
<link>
- Type, class, and ID selectors
- Colors, fonts, and text alignment
margin
,padding
, andborder
- Display basics
PART A: Set Up HTML
- Open a new Codespace and ensure the HTML boilerplate looks correct.
- Within the
<head>
section, set the<title>
toNYC Subway Schedule
. - Inside the
<body>
section, copy in the starter code:
<h1 id="page-title">NYC Subway Schedule</h1>
<p>Welcome to todayβs schedule. Check your train line for the latest stops and updates.</p>
<h2 class="line-name">A Train</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/6/6a/NYCS-bull-trans-A.svg" alt="A Train">
<ul>
<li>Inwood β 207 St</li>
<li>59 St β Columbus Circle</li>
<li>42 St β Port Authority</li>
<li>Jay St β MetroTech</li>
<li>Far Rockaway β Mott Ave</li>
</ul>
<h2 class="line-name express">1 Train</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/1/13/NYCS-bull-trans-1.svg" alt="1 Train">
<ul>
<li>Van Cortlandt Park β 242 St</li>
<li>96 St</li>
<li>42 St β Times Sq</li>
<li>Chambers St</li>
<li>South Ferry</li>
</ul>
PART B: Basic Styling
-
In
styles.css
, use the universal selector to reset the box model:* { box-sizing: border-box; }
-
Style the
body
:- Set a background color.
- Choose a font family (e.g. Arial, sans-serif).
- Add some padding around the page.
-
ID selector:
#page-title
β large font size, centered text, bold color.
-
Class selector:
.line-name
β background color, white text, padding.
-
Give
.express
a different background or text style.
PART C: Lists and Images
- Make all station lists (
ul li
) have extra padding and a border-bottom. -
Make images:
- A fixed width (e.g. 80px)
height: auto
- A border-radius for rounded corners.
- Use a descendant selector so that only images inside
.express
get a colored border.
PART D: Box Model Practice
- Add
margin
between each train section to create space. - Add
padding
inside the.line-name
headings. - Give one section a
border
to help it stand out.