Your First Website Is One File Away

Every developer remembers the first page they put on the internet. It was almost never impressive — a heading, a paragraph, a link, maybe a colour they chose themselves — and that is exactly why it mattered. It was theirs, it was visible, and it proved the web is not something other people make. It is files, and files are something you can write.

Most students wait too long. They think a website needs a framework, a server, and a domain name, so they keep doing tutorials and never ship a page. But a website, at its smallest, is a single file that a browser knows how to read. That file holds three languages, each with one job: HTML says what is on the page, CSS says what it looks like, and JavaScript says what it does. Those three jobs are what every website is made of.

The Page: A Study Page About You

The page in this article belongs to Asha, a second-year CS student. It says who she is, what she is studying, and where to find her work. Then it does one useful thing: it tracks her study goal — 120 minutes a day, 45 done, and a button that adds 25 minutes per study block. A page that says something true and does one useful thing is a real website.

Try It: Your Page in One File

Paste it into the browser editor as a new HTML snippet and run it — the page appears in the preview panel, where you can switch between phone, tablet, and desktop widths. Change the name to yours first: the page is only yours when it says your name.

<!DOCTYPE html>
<html>
<head> <meta charset="utf-8"> <title>Asha — Study Page</title> <style> body { font-family: system-ui, sans-serif; max-width: 600px; margin: 40px auto; padding: 0 16px; color: #222; } h1 { color: #1a56db; }.card { border: 1px solid #ddd; border-radius: 12px; padding: 16px; } button { background: #1a56db; color: white; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; } </style>
</head>
<body> <h1>Hello, Asha</h1> <p>Second-year CS student. This week: Python, databases, and one small project.</p> <div class="card"> <p id="greeting"></p> <p>Study goal: <strong>120 minutes</strong></p> <p>Done so far: <strong id="done">45 minutes</strong></p> <p>Left today: <strong id="left"></strong></p> <button id="add">I studied 25 more minutes</button> </div> <p><a href="https://github.com/asha">My GitHub</a> · <a href="https://coderfile.io">Built in CoderFile</a></p> <script> function greetingFor(hour) { if (hour < 12) return "Good morning — fresh brain, hard topic first."; if (hour < 18) return "Good afternoon — steady work, one problem at a time."; return "Good evening — review, don't start anything new."; } function minutesLeft(goal, done) { return Math.max(0, goal - done); } let done = 45; const goal = 120; document.getElementById("greeting").textContent = greetingFor(new Date().getHours()); document.getElementById("done").textContent = done + " minutes"; document.getElementById("left").textContent = minutesLeft(goal, done) + " minutes"; document.getElementById("add").addEventListener("click", function () { done = done + 25; document.getElementById("done").textContent = done + " minutes"; document.getElementById("left").textContent = minutesLeft(goal, done) + " minutes"; }); </script>
</body>
</html>

Read the file top to bottom before you run it: the head holds the title and the style, the body holds the words and the button, and the script sits at the very end — that order is the load order, and it is why the page works.

What the Page Does When You Run It

The greeting depends on the hour you open the page. At 9 in the morning it says "Good morning — fresh brain, hard topic first.", at 2 in the afternoon it says "Good afternoon — steady work, one problem at a time.", and at 9 in the evening it says "Good evening — review, don't start anything new." At noon it switches to afternoon; at 6pm, to evening.

The timer starts at 45 of a 120-minute goal, so 75 minutes are left. One click shows 70 done and 50 left; a second shows 95 and 25; a third reaches the goal exactly, 120 done and 0 left. Click a fourth time and the done number keeps climbing to 145, but the minutes left stay at 0 — the page never shows a negative number, because minutesLeft takes the larger of zero and the difference.

Anyone can subtract 45 from 120; the skill is asking what happens when the numbers stop making sense, and answering it in code before a user finds it. A page that handles the fourth click is a page you can trust.

How the Three Languages Split the Work

HTML is the structure: the heading, the paragraphs, the card, and the button, each with an id the script can find. The ids are the contract between the page and the script — greeting, done, left, and add — and renaming one in the HTML means renaming it in the script too.

CSS is the look, and it is doing less than you think: a readable font, a narrow column so lines stay short, a blue heading, a bordered card, and a blue button. Write the words first; style one rule at a time.

JavaScript is the behaviour, in four short moves. greetingFor turns an hour into a sentence. minutesLeft turns a goal and a done number into the minutes left, floored at zero. Three lines fill in the greeting and both numbers when the page loads. And the click listener adds 25 to done and updates both numbers — the only part of the page that changes after it loads, so it is the only part that needs an event.

What Breaks, and What It Teaches You

The first break is a mistyped id. Ask for "Add" when the button says "add" and the lookup finds nothing; setting text on nothing stops the page with a TypeError about a property of null. It is an unfriendly message for a one-letter mistake — the fix is spelling the id the same way in both places.

The second break is putting the script in the head. The browser reads top to bottom, so a script in the head runs before the body exists — the elements are not there yet, and you get the same null error. That is why the script sits at the end of the body.

The third break is forgetting Math.max. Without it, the fourth click shows minus 25 minutes left — arithmetically correct and obviously wrong. Guarding an edge case you can already see is a habit: when a number can cross zero, say what should happen and write it down.

Make It Yours: From One Page to a Portfolio

Change the name, subjects, goal, and links, and the page is yours. Then give it one more job: a second card listing this week's project, or your three favourite resources for the subject you are studying. Each addition is one small edit and one run.

When the page reads the way you want, save it as a snippet called "first-website-study-page" with a one-line note: "my first website — one HTML file, personal page with a study timer." Then share the link with a classmate and ask them to open it on their phone: if it reads well there, you have built a page, not a desktop demo. A personal page is also the first piece of a portfolio — the portfolio guide shows how to pin it on GitHub.

When the Free Plan Runs Out

A page you keep improving burns executions fast. Free gives you 20 executions a day, 10 AI requests a day, 10 saved snippets, 3 private snippets, and 3 collaborators per snippet. When it becomes a daily project, that is the upgrade moment: Pro is $9/month or $69/year — unlimited saved snippets and executions, 100 AI requests a day, 10 collaborators per snippet, unlimited private snippets, and GitHub integration. Team ($19/user/month, or $15/user/month billed annually) covers a class or study group building together — see the pricing page.

Your next step is tonight: paste the code above into the browser editor, change Asha to your name, run it, and watch it greet you and count down your study goal. Then save it as a snippet called "first-website-study-page" and send the link to one person. The first time someone else opens a page you built, a website stops being something you read about and starts being something you make.