Under the hood
HTML, CSS and JavaScript explained: what each one does
The three languages behind almost every web page, explained simply — structure, style and behaviour — with tiny examples and how they work together.
By the GenKid team · · Updated · Facts checked · 4 min read
Key takeaways
- Almost every web page is built from three languages: HTML for structure, CSS for style and JavaScript for behaviour.
- A simple way to remember: HTML is the skeleton, CSS is the clothes, JavaScript is the muscles.
- All three run in the web browser, so you can see results instantly — great for beginners.
- When AI builds a web app, it usually writes all three; reading them is how you check its work.
- You don't need to memorise everything; learning to read and change each one is the first goal.
The three languages of the web
Open almost any website and you'll find three kinds of code working together:
| Language | Job | Think of it as |
|---|---|---|
| HTML | What's on the page: headings, text, buttons, images | The skeleton |
| CSS | How it looks: colours, fonts, sizes, layout | The clothes |
| JavaScript | What it does: reacting to clicks, changing things, keeping score | The muscles |
They all run in the web browser — the app you use to visit websites — which is why they're such a good place to start. Write some code, refresh the page, and you see the result straight away.
What is HTML? The structure
HTML (HyperText Markup Language) is the language that describes what's on a web page and how it's organised: headings, paragraphs, buttons, images. MDN calls it the most basic building block of the Web. It uses tags in angle brackets to mark up content:
<h1>Planet Wobble</h1>
<p>A jelly planet with three moons.</p>
<button id="fact">Show a fact</button><h1> is a main heading, <p> is a paragraph and <button> is a button. HTML doesn't decide colours or what the button does — just what's there.
Good HTML also helps everyone use the page: screen readers rely on proper headings and labels, and search engines use them to understand what a page is about (see SEO basics for young makers).
What is CSS? The style
CSS (Cascading Style Sheets) controls how things look. It picks parts of the page and sets their style:
h1 {
color: purple;
font-size: 48px;
}
button {
background: teal;
border-radius: 12px;
}This makes the heading big and purple and the button teal with rounded corners. CSS also handles layout — placing things side by side, and adjusting the design for phone screens.
What is JavaScript? The behaviour
JavaScript is a programming language that makes pages interactive. It can respond to clicks, change text, do calculations and remember things while the page is open:
const facts = ["It wobbles when it spins.", "Its moons are made of ice."];
document.querySelector("#fact").addEventListener("click", () => {
const pick = facts[Math.floor(Math.random() * facts.length)];
document.querySelector("p").textContent = pick;
});When the button is clicked, this picks a random fact and puts it in the paragraph. That's a complete, working feature in a few lines.
How they work together
When you visit a page:
- The browser loads the HTML and builds the page's structure.
- It applies the CSS to style it.
- It runs the JavaScript, which waits for things like clicks and changes the page in response.
Change any one of them and you'll see the effect. That's what makes web development so good for learning: everything is visible and instant.
What about the "back end"?
HTML, CSS and JavaScript in the browser are the front end — the part users see. Many apps also have a back end running on a server, which stores data, handles accounts and keeps secrets safe. See front end vs back end.
Learning them with AI
When you ask an AI coding tool to build a web app, it usually writes all three languages. That makes reading them essential: you can only check what the AI built if you can follow it. A good way to start:
- Find the HTML for each thing you see on screen.
- Change a CSS colour or size and see what happens.
- Find the JavaScript that runs when you click a button, and explain it in your own words.
- When something breaks, read the error message before asking for a fix; debugging for beginners shows how.
This "read, predict, change" approach is backed by research; see PRIMM explained. And always check AI code before trusting it — see how to review AI-generated code. If your child is moving on from block coding, from Scratch to real code explains how the ideas carry over.
GenKid's projects use plain HTML, CSS and JavaScript in a safe browser sandbox, and the optional Code Craft courses teach writing them by hand. See the pathway.
Frequently asked questions
Is HTML a programming language?
HTML is a markup language: it describes structure rather than giving step-by-step instructions. JavaScript is a programming language. Both are essential for building web pages.
Which should I learn first: HTML, CSS or JavaScript?
Most people start with HTML, then CSS, then JavaScript, because each builds on the one before; MDN's beginner course, [Your first website](https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website), teaches them in that order. With AI tools, you can learn to read all three together as you build.
Is JavaScript the same as Java?
No. Despite the similar names, MDN points out that they have very different syntax and uses. JavaScript is best known as the language of web browsers, and it also runs on servers.
What age can kids learn HTML?
There's no fixed age. Children who read and type comfortably can start changing simple HTML and CSS, because the results appear instantly in the browser and mistakes are rarely serious. What matters more than age is readiness; see [the best age to start coding](/blog/best-age-to-start-coding).
Sources
- HTML: HyperText Markup Language (opens in a new tab) — MDN Web Docs
- JavaScript (opens in a new tab) — MDN Web Docs
- Your first website (opens in a new tab) — MDN Web Docs
How we write: GenKid articles are researched and drafted with the help of AI tools, then checked in a separate review step against the sources listed above before they are published, and re-checked when they are updated. Rules and products change, so check official pages for your country before acting on anything here. This article is general information, not legal advice. Spotted a mistake? Email hello@genkid.app.