Every web page is built by two partners. HTML is the code used to structure a web page and its content โ the headings, the words, the lists. CSS is the code you use to style your webpage โ the colors, the sizes, the borders. Think of HTML as the builder and CSS as the painter.
On this page you will copy one small, real web page and open it in a browser. It has a big heading, a grumpy cat sentence (borrowed from MDN's own first lesson), a pretend picture box, and a list โ all painted with CSS. Every piece comes from MDN's official first lessons in HTML and CSS.
Pick your grade:
Here is a secret from MDN itself: HTML is not a programming language; it is a markup language. That means HTML does not give the computer orders to carry out. It puts labels on the parts of a page: "this is a heading," "this is a paragraph," "this is a list." The labels are called tags, and they look like this: <p> and </p>.
CSS rules say how the labeled parts should look. A rule names a part of the page, then says its color, size, or border. The very first rule in MDN's CSS lesson paints every paragraph red. You will use that exact rule in your page.
Your page has a picture placeholder โ a painted orange box that holds the place where a picture will go later. It is just a paragraph wearing a costume of CSS. There is no real picture in this first page, and no picture is fetched from anywhere else. Adding real pictures is a later lesson.
Do it with a grown-up:
1. Open a plain text editor (a grown-up can help you find one).
2. Tap Copy the code below and paste the whole thing into the editor. You can also select the code by hand and copy it that way.
3. Save the file with the name my-first-page.html
4. Open the file in a web browser. Your page appears!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My first web page</title>
<style>
p {
color: red;
}
h1 {
font-size: 60px;
text-align: center;
}
.picture {
width: 300px;
border: 5px solid black;
background-color: #FF9500;
color: black;
text-align: center;
}
</style>
</head>
<body>
<h1>My main title</h1>
<p>My cat is <strong>very</strong> grumpy.</p>
<p class="picture">Your picture will go here</p>
<ul>
<li>technologists</li>
<li>thinkers</li>
<li>builders</li>
</ul>
</body>
</html>
<!DOCTYPE html>: The very first line of every HTML page. It tells the browser, "this is a web page."
<head>: The setup area. The title is the name on the browser tab. The <style> part holds this page's CSS โ its painting rules.
p { color: red; }: A CSS rule. It paints every paragraph red โ MDN's first CSS rule ever.
h1 { font-size: 60px; text-align: center; }: A rule that makes the main heading big (60 pixels) and centered โ MDN's heading rule.
.picture { ... }: A rule for any part wearing the name "picture." The dot means it is a class name โ a costume label. It gives the box a width, a thick black border, and an orange inside.
<body>: Everything you actually see on the page lives here.
<h1>My main title</h1>: The main heading โ MDN's own example words.
<p>My cat is <strong>very</strong> grumpy.</p>: A paragraph โ MDN's own example sentence, with "very" nested in a strong element so it comes out bold.
<p class="picture">: A paragraph wearing the "picture" costume โ your picture placeholder.
<ul> and <li>: A bulleted list. Each <li> is one list item โ MDN's example list: technologists, thinkers, builders.
A huge centered heading at the top: My main title.
Under it, red words: My cat is very grumpy. โ with "very" in bold.
Then an orange box with a thick black border that says Your picture will go here.
Then a list with three bullets โ technologists, thinkers, builders โ in the normal dark color, not red. Why not? The red rule's selector names only paragraphs (p). A rule paints only what its selector names. That is how CSS works.
If the page shows the code itself as words, the file was probably saved as a text file. Save it again with .html at the end of the name.
1. In the first CSS rule, change red to blue. Save and reload. All the paragraphs change color at once โ that is the power of one rule.
2. Change the cat sentence to a sentence about your own pet, or an animal you like.
3. Change the heading size โ 60px โ to 40px, then to 90px. Watch the heading shrink and grow.
4. Change the words inside the picture box to describe the picture you will add someday.
HTML: The code that structures a web page and its content. A markup language, not a programming language.
CSS: The code that styles a web page โ colors, sizes, borders, and spacing.
Tag: A label in pointy brackets, like <p>, that marks what a part of the page is.
Element: An opening tag, its content, and its closing tag, all together.
Selector: The first part of a CSS rule โ it names which part of the page the rule paints.
Class: A costume label you give to a page part, so CSS rules can find it by name. In CSS it is written with a dot, like .picture.
Placeholder: Something that holds a place for something that comes later โ like the picture box on this page.
This set of guides also has a JavaScript First Steps page โ how to make a page answer back when a button is clicked โ and a cheat sheet of the top 10 programming languages for kids. Grown-ups who want every detail can read MDN's own HTML and CSS lessons, listed below.
MDN Web Docs, developer.mozilla.org โ "HTML basics" ("HTML (Hypertext Markup Language) is the code that is used to structure and display a web page and its content"; "HTML is not a programming language; it is a markup language"; the element anatomy; the grumpy cat paragraph and its nested strong version; the page skeleton with doctype, html, head, meta charset, title, and body; the main title heading; the technologists / thinkers / builders list). "CSS basics" ("CSS (Cascading Style Sheets) is the code you use to style your webpage"; the first rule p { color: red; }; ruleset anatomy โ selector, declaration, property, property value; the heading rule with font-size: 60px and text-align: center; the border value 5px solid black and the background color #FF9500 from the body rule; the box layers โ padding, border, margin; class selectors written with a dot). One honest difference: MDN's lessons keep CSS in its own file, joined to the page with a link. This starter keeps the same CSS rules in a <style> block inside the page's head, so a beginner needs only one file.
Checked against MDN's lessons on November 7, 2026.
Related guides: Top 10 Programming Languages, Learning JavaScript, Learning Lua, Learning Scratch and Long Division Steps.