🌐 HTML and CSS: Building a Web Page
5th Grade 💻 Coding
Every web page you see — this one too — is built with a language called HTML. It tells the browser what’s on the page: here’s a heading, here’s a paragraph, here’s a picture. Another language, CSS, tells it how everything should look: colors, sizes and spacing. In this lesson we get to know both of them and build a small page of our own.
How the web was born
In 1989, a British scientist named Tim Berners-Lee, who worked at the CERN research center in Switzerland, proposed a new way to share documents between computers: pages linked to one another by links. He invented HTML for writing the pages, and he also built the first web browser and the first web server. The first website went online in the early 1990s, and it explained what this “web” even was.
HTML stands for “HyperText Markup Language.” “Hypertext” means text with links that lead to other text. HTML isn’t a programming language in the full sense — it has no loops or conditions. It’s a markup language: it labels each part of the page with what it is. But it’s the foundation every website is built on, and anyone who builds websites learns it first.
Tags: the bricks of the page
HTML is made of tags — words inside angle brackets. Most tags come in pairs: an opening tag and a closing tag, which has a slash. Whatever is between them is the content. <h1>My Page</h1> is a main heading. <p>I love basketball</p> is a paragraph. There are headings in sizes h1 through h6, where h1 is the biggest and most important.
Some tags have attributes — extra information written inside the opening tag. A link is written like this: <a href="https://example.com">Click here</a>, where href is the address the link leads to. A picture is written like this: <img src="cat.png" alt="A sleeping cat"> — src is the image file, and alt is a description in words, which is important for blind people who use software that reads the page aloud. An image has no closing tag. A bulleted list is made of <ul> with items inside it in <li> tags.
CSS: the page’s clothes
HTML decides what’s on the page, and CSS decides how it looks. CSS is written as rules: you choose which part to style, and inside curly braces you write properties and values. For example, h1 { color: purple; } colors all the main headings purple. p { font-size: 20px; } makes the paragraph text bigger. Each property ends with a semicolon.
The big advantage: if you have a website with a hundred pages and want to change the color of the headings, you change one line in the CSS file — and every page updates. CSS can also place things side by side, add borders and rounded corners, and even make the page fit both a phone and a computer screen. Colors can be written as names, like purple, or as codes, like #800080 — which is the same purple.
Your first page
To build a page, open a simple text editor, write the HTML and save the file with a name that ends in .html, for example index.html. Double-click it — and the browser opens it and shows the page. You don’t need an internet connection to see a page saved on your own computer. For other people to see it, you need to upload it to a server, and that’s a more advanced step.
An idea for practice: a page about your hobby. A main heading with the name of the hobby, a paragraph explaining why you love it, a list of three facts and a link to an interesting website about it. Then add CSS: a background color, a color for the heading and a size for the text. And if you want the page to react — for a button to do something when you click it — you need the third language of the web: JavaScript. That’s in the next lesson. Important: never put personal details like your address, phone number or school on the page.
Key facts
- Tim Berners-Lee proposed the web in 1989 at CERN and invented HTML.
- HTML is a markup language: it labels each part of the page with what it is.
- Most tags come in pairs — an opening tag and a closing tag with a slash.
- CSS decides how the page looks: colors, sizes, spacing and layout.
- The alt attribute on an image describes it in words for people who can’t see it.
Quick quiz
What does HTML do?
Who invented HTML and the web?
What does the closing tag of a paragraph look like?
Which tag makes a link?
Why is the alt attribute on an image important?
What does CSS do?
What will the rule h1 { color: purple; } do?
How do you save a web page file?
💭 Think and talk about it
- On a sheet of paper, plan a web page about your hobby: what headings, paragraphs and pictures will it have?
- Why do you think it’s useful to keep HTML (content) separate from CSS (looks)?
- How does good alt text help people with low vision? Write alt text for a picture you love.
Questions kids ask
Is HTML a programming language?
Not in the full sense. HTML is a markup language: it describes what’s on the page, but it has no conditions, loops or variables. To make a page react and calculate, you use JavaScript. Even so, HTML is the first step for everyone who builds websites.
What’s the difference between HTML and CSS?
HTML decides the content and structure — what’s a heading, what’s a paragraph, where a picture goes. CSS decides the design — colors, fonts, sizes and layout. You can change a website’s whole design without touching its content.
Do I need special software to write HTML?
No. Any plain text editor that comes with your computer will do, as long as you save the file with a name ending in .html. Many people later switch to a free code editor that colors the tags and helps catch mistakes.