BrightKidz Library
Subjects
A web page open in a browser window A browser window with three small round buttons and a long address bar across the top. Inside it a web page is laid out: a thick heading bar, three lines of text of different lengths beneath it, and a picture box on the right with a simple mountain and sun drawn inside.

Coding: Creating a Simple Website

About 4 minutes

A website is a file on your computer. That is the whole secret. You write it with a language called HTML, save it, and open it in a browser — no special software, no account, nothing to install.

The Code

This is a complete website. Every part of it is explained further down.

<!DOCTYPE html>
<html>
<head>
  <title>My First Website</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <p>This is my first website!</p>
</body>
</html>
  1. Open your text editor and start a new, empty file.
  2. Type the code above. Typing it by hand rather than copying is slower and teaches you far more, because every mistake is one you then have to find.
  3. Save it as mywebsite.html. The .html on the end is the part that matters — it is what tells your computer this is a web page.
  4. Open your browser and drag the saved file into it. Your website loads.

What Each Line Does

Notice the pattern: nearly every tag comes in a pair, like <p> and </p>. The one with the slash closes it. The browser reads the opening tag as "start being a paragraph" and the closing tag as "stop now".

Every paragraph ends with a closing tag. What is it for?

Change It

Save the file again and reload the browser tab each time. That loop — change, save, reload — is what building a website actually feels like.

If It Goes Wrong