Lesson 1 of 4
Static website basics
The three files behind every web page — and why "static" is exactly what you want.
What is a "static" website?
A static website is just a set of files that a web browser can open and display directly — nothing has to be computed on a server first. When someone visits, the server hands over the files exactly as they are. That's it.
The opposite is a dynamic site (think Facebook or your bank), where a server builds a fresh, personalized page for every request using databases and code. Dynamic sites are powerful but heavier to build and host.
The three files behind every page
Nearly every web page is made of three languages, each with one job:
The structure (the skeleton)
HTML holds your content and gives it meaning: "this is a heading", "this is a
paragraph", "this is a link". Files end in .html.
The style (the skin & clothes)
CSS decides how things look — colors, fonts, spacing, layout, dark mode. Files
end in .css. The whole look of this site comes from one CSS file.
The behavior (the muscles)
JavaScript adds interactivity — the theme toggle in the corner, the "copy" buttons,
the mobile menu. Files end in .js. Optional, but handy.
Build one right now
You don't need any special software — just a text editor and a browser. Create a file
called index.html, paste this in, and open it in your browser by
double-clicking it:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Website</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hello, world! 👋</h1>
<p>This is my very first web page.</p>
<button id="btn">Click me</button>
<script src="script.js"></script>
</body>
</html>
Add a style.css file next to it to make it look nice:
body {
font-family: sans-serif;
max-width: 600px;
margin: 40px auto;
padding: 0 20px;
}
h1 { color: #f6821f; }
button {
padding: 10px 18px;
border: none;
border-radius: 8px;
background: #f6821f;
color: white;
cursor: pointer;
}
And a script.js file to make the button do something:
document.getElementById("btn").addEventListener("click", function () {
alert("You clicked the button! 🎉");
});
A tidy folder structure
As a site grows, people usually group files into folders. Here's how this site is organized:
building-website/
├── index.html ← the home page
├── 01-static-website-basics.html
├── 02-github.html
├── 03-claude-code.html
├── 04-cloudflare-pages.html
├── css/
│ └── style.css ← all the styling
├── js/
│ └── main.js ← all the interactivity
└── favicon.svg ← the little tab icon
The magic filename is index.html — web servers automatically show it when
someone visits your site's address, so it's always your home page.
Next up: your files live on your computer right now. Let's give them a safe home in the cloud and start tracking every change — with Git and GitHub.