Day 1 — HTML: Structure & Content
Tags · Headings · Images · Links · Lists · A first taste of CSS
⬇ Today's slides (PDF)Step 1 — Set Up Your Editor
You'll write your code in VS Code and preview it in the browser with a tool called Live Server that auto-refreshes every time you save. Get set up before you write any code:
- Open VS Code (already installed on the lab machines).
- Click the Extensions icon in the left sidebar (the four-squares icon), or press
Ctrl+Shift+X. - Search for Live Server (by Ritwick Dey) and click Install.
- Make a folder for your project (e.g.
my-site) and open it in VS Code: File → Open Folder. - Create a new file called
index.htmlinside it. - Once it has some HTML, right-click
index.htmland choose "Open with Live Server" — your page opens in the browser.
Ctrl+S), the page refreshes automatically. Edit, save, look — that's the whole loop.
Step 2 — Pick Your Theme
You'll build one website all week. Pick a theme now and stick with it. Every theme uses the exact same tags — only your words and pictures change.
- Fan page — a game, band, team, show, athlete, or car (our example below)
- Recipe / food site — a dish or cuisine you love
- Review site — rate 5 movies, games, or restaurants
- Fake business — a dog-walking service, food truck, or band's booking page
- Event page — a party, tournament, or club
- Tool page — a tip calculator, quiz, or countdown (more JavaScript on Day 4)
Schedule
| Time | Activity |
|---|---|
| 0:00 – 0:15 | Setup: VS Code + Live Server, pick your theme |
| 0:15 – 0:40 | Lecture: what is a webpage? tags, elements, view-source |
| 0:40 – 1:20 | Project: build your page skeleton |
| 1:20 – 1:30 | Break |
| 1:30 – 2:00 | Lecture: links, images, and lists |
| 2:00 – 3:00 | Project: fill in real content for your theme |
How HTML Works
An HTML page is built out of tags. Most tags come in pairs — an opening tag and a closing tag — with your content in between. The closing tag has a slash.
<h1>This is a big heading</h1>
<p>This is a paragraph of text.</p>
Tags can go inside other tags. This is called nesting, and it's how you build structure:
<ul>
<li>First item</li>
<li>Second item</li>
</ul>
Quick Reference — Tags You'll Use Today
The Page Skeleton
Every HTML file starts with this structure. The <head> holds settings (like the title), and the <body> holds everything you actually see.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Page</title> <!-- shows in the browser tab -->
</head>
<body>
<!-- your visible content goes here -->
</body>
</html>
Headings and Text
<h1>Biggest heading</h1> <!-- use ONE h1 per page -->
<h2>Section heading</h2>
<h3>Smaller heading</h3>
<p>A paragraph of normal text.</p>
<strong>bold text</strong> and <em>italic text</em>
Images
The <img> tag has no closing tag. src is the file name, alt is a text description (shown if the image fails to load).
<img src="hero.jpg" alt="A description of the picture">
Links
The href is where the link goes when clicked.
<a href="https://developer.mozilla.org/">Click here</a>
Lists
<ul> <!-- ul = unordered (bullets) -->
<li>Apples</li>
<li>Oranges</li>
</ul>
<ol> <!-- ol = ordered (numbered) -->
<li>First step</li>
<li>Second step</li>
</ol>
Project — Build Your Page Skeleton
Every theme uses the same four pieces: a heading, an image, an intro paragraph, and a list. Here's the worked example as a fan page — copy it, then swap in your own theme.
Starter Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ultimate Fan Page</title>
</head>
<body>
<h1>The Ultimate Zelda Fan Page</h1>
<img src="hero.jpg" alt="Screenshot from the game">
<p>The Legend of Zelda is my favorite game series. Here's why it's the best.</p>
<h2>My Top 3 Games</h2>
<ul>
<li>Breath of the Wild</li>
<li>Ocarina of Time</li>
<li>Majora's Mask</li>
</ul>
<a href="https://zelda.nintendo.com/">Official site</a>
</body>
</html>
Your Theme Fits the Same Shape
| Theme | <h1> | <img> | <p> | <ul> |
|---|---|---|---|---|
| Recipe | Dish name | Photo of the dish | Why you love it | Ingredients |
| Review site | "My Top 5 Movies" | Poster of #1 | What the list is | The ranked items |
| Fake business | Business name | Logo / hero photo | What you offer | Services |
| Event | Event name | Poster / venue photo | The pitch | Schedule / details |
index.html. Right-click it and open with your browser (or use the Live Server button in VSCode) to see your page.
Stretch Goals
- Add a table (games with a rating column, a menu with prices, etc.)
- Add a second page and link the two together
- Embed a YouTube video with an
<iframe> - Use a
<details>/<summary>collapsible section - Look up 3 tags you've never seen on MDN and use them
A First Taste of CSS
HTML is your content; CSS is how it looks. The quickest way to try it is a <style> block inside your <head>. Each rule picks a tag, then sets what to change:
<head>
<title>My Page</title>
<style>
body { background: #f4f4f8; }
h1 { color: purple; }
</style>
</head>
Three properties get you a long way. Try changing the values:
body {
background: #f4f4f8; /* page background */
color: #222; /* text color */
font-family: sans-serif;
}
#hex code from a color picker like htmlcolorcodes.com/color-picker and paste it into your CSS. Tomorrow (Day 2): classes, ids, the box model, and more advanced CSS.
Add a Second Page (Stretch)
Want an "About" page too? Make a second file — about.html — in the same folder, give it the same skeleton, then link the two together. A link to your own page just uses the file name (no https://):
<!-- put this on both pages so you can jump back and forth -->
<a href="index.html">Home</a>
<a href="about.html">About</a>
https://... address. Linking to a file you made yourself just needs the file name.
Save Your Work with Git & GitHub
A version control system saves snapshots of your project as you work, so a bad edit can never wipe out your progress. Git is the tool that takes the snapshots; GitHub is the website that stores them online. Almost every programmer uses both.
- Undo — jump back to any earlier snapshot that worked.
- Backup — your files live online, not just on one computer.
- History — see exactly what changed, and when.
The Workflow, Start to Finish
Step 1 — create the repo. Make a free account at github.com, click New repository, and give it a name (e.g. my-site).
push.
Step 2 — clone it. Copy the repo's URL, then clone to pull a copy down onto your computer. Cloning makes a folder that's already linked to GitHub — no other setup needed:
git clone https://github.com/you/my-site.git
Step 3 — go in and make changes. Step into the folder (open it in VS Code) and edit your files:
cd my-site # step into your project folder
# ...edit index.html, add images...
Step 4 — save a snapshot and upload it. A commit is one saved snapshot with a short message; push sends it up to GitHub:
git add . # gather up all your changes
git commit -m "My first web page" # save a snapshot
git push # upload it to GitHub
Repeat steps 3–4 every time you get something working.
Common Mistakes
Everyone hits these on Day 1 — here's how to spot and fix them.
- Forgot the closing tag. Every
<h1>needs a matching</h1>. If half your page is suddenly a giant heading, you're missing a</h1>. - Slash on the wrong side. The closing tag's slash goes before the name:
</p>, not<p/>. - Image doesn't show. Check the file name in
srcmatches exactly (including.jpgvs.png) and the image is in the same folder as your HTML. - Nothing updates. Did you save (
Ctrl+S)? Live Server only refreshes after a save. - Tags overlap. Close tags in the reverse order you opened them:
<p><strong>hi</strong></p>, not<p><strong>hi</p></strong>.