Coding For Kids & Teens

Basic HTML Code for Students: A First Page in 20 Minutes

Every web page your child has ever opened is, underneath, a text file full of tags. Learning basic HTML code for students is less about memorising a language and more about one realisation that tends to land hard and stay: the web is not magic, it is written down, and you can write it too.

The practical appeal is that nothing needs installing. A text editor and a browser are already on the computer, which means a child can go from nothing to a page on screen inside twenty minutes. Very little else in computing offers that.

What follows is the version I teach: ten tags, one starter file, and an honest note about what HTML will not do for your child.

What HTML is, and what it is not

HTML stands for HyperText Markup Language. The important word is markup. HTML describes what content is: this is a heading, this is a paragraph, this is a link. It does not describe what a computer should do.

That distinction matters for a decision parents face early. HTML has no loops, no conditions, no variables. A child cannot write a game in it, or a calculator, or anything that responds to a rule. So if your child's goal is to build games, HTML is a detour, and a long one. If their goal is to publish something, HTML is exactly right and the fastest win in computing.

Both paths are legitimate and they are genuinely different. Our comparison of Scratch and Python covers the logic route, and frontend versus backend covers where HTML sits in a web career.

The starter file, line by line

Ask your child to open a plain text editor, type this out rather than pasting it, and save it as index.html. Typing it is not busywork: the errors they make while typing are the lesson.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My first page</title>
  </head>
  <body>
    <h1>Hello from Priya</h1>
    <p>This page is about my dog.</p>
  </body>
</html>

Now double-click the file. It opens in a browser, and it is a real web page. Here is what each part did.

  • The doctype line tells the browser to read the file as modern HTML. It goes first, always, and it is the one line nobody needs to understand yet.
  • html wraps everything. The lang="en" part tells screen readers which language to pronounce.
  • head holds information about the page rather than content on it. Nothing in the head appears in the window.
  • title is the text in the browser tab. Children usually miss this, then find it, and the effect is much bigger than it deserves to be.
  • body holds everything a visitor actually sees.
  • h1 is the main heading, and p is a paragraph.

Notice the pattern: almost every tag opens and closes, and the closing one carries a slash. Forgetting a closing tag is the single most common beginner error, and the symptom is that half the page suddenly looks wrong.

The ten tags that cover most pages

Tutorials that list eighty tags produce children who can copy and cannot build. Ten is enough for a real page, and knowing ten well beats meeting eighty once.

TagWhat it doesWorth knowing
h1 to h6Headings, most to least importantUse one h1 per page. Do not skip from h1 to h4 because the size looks nicer.
pA paragraphDo not use empty paragraphs to make space. That is what styling is for.
aA linkNeeds an href, as in <a href="https://www.codeyoung.com">.
imgAn imageAlways give it alt text describing the picture, for readers who cannot see it.
ul and liA bulleted list and its itemsEvery li lives inside a ul or ol.
olA numbered listUse it when order matters, such as steps.
strongText that mattersMeans importance, not just bold pixels.
emEmphasisMeans stress, not just italics.
divA generic boxUseful for grouping. Easy to overuse.
brA line breakNo closing tag. Use rarely, in addresses and poems.

Not sure which level your child should start at? A free trial class with a Codeyoung teacher shows you exactly where they are and what they are ready for next, before you commit to anything.

Book a Free Trial →

Why teach strong and em instead of b and i?

On screen, strong usually looks the same as b, and em looks the same as i. So why bother with the longer ones?

Because they mean different things. b asks for bold pixels. strong says this text is important, which is information a screen reader can act on and a search engine can weigh. Same appearance, different meaning, and only one of them survives contact with a reader who is blind.

This is the earliest place a child meets the idea that code communicates to more than one audience. It costs nothing to teach it correctly the first time, and it is a genuine nuisance to unteach later.

What should a child build first?

Not a copy of a famous website. Something small, personal and finishable in one sitting, so the feedback loop closes while they still care.

  1. A page about one thing they like. A pet, a game, a football team. One heading, three paragraphs, one image, one link.
  2. A list page. Their top ten anything, as an ordered list. This teaches nesting, because the li tags sit inside the ol.
  3. A two-page site. Two files in the same folder, linking to each other. The moment a child clicks their own link and their own second page appears, HTML stops being an exercise.

For more ideas at this level, our short web projects for kids are all buildable in half an hour.

Infographic showing the structure of a basic HTML starter file with head and body sections, the ten essential HTML tags for students, and the three most common beginner errors

The three errors every beginner makes

Knowing these in advance turns a frustrating afternoon into a five-minute fix.

  • A missing closing tag. Everything after it inherits the wrong formatting. Look above the point where the page went wrong, not at it.
  • A file saved as .txt. The page opens as plain text showing all the tags. The fix is renaming it so it genuinely ends in .html, which on some computers means switching on file extensions first.
  • A broken image path. The image sits in a different folder from the page. Keep everything in one folder at first, and name files in lowercase with no spaces.

There is a habit worth building alongside these: change one thing, predict what will happen, then reload and check. A child who predicts before reloading is debugging. A child who changes five things and reloads is guessing, and guessing does not get better with practice.

Where does HTML lead?

HTML alone makes a page that works and looks plain. The next two steps are CSS, which controls how it looks, and JavaScript, which finally adds the logic HTML cannot express. That trio is the whole front end of the web, and our beginner's guide to web development for kids maps the order they are usually learned in.

A reasonable pace for a motivated 10 to 12 year old: a fortnight on HTML until pages feel easy, then CSS, then JavaScript once they are asking for things to move or respond. Rushing to JavaScript before HTML is comfortable tends to produce a child who can follow a tutorial and cannot start a blank file, which is the outcome worth avoiding.

If you would rather this were structured, Codeyoung's web development classes for children follow that sequence with a teacher watching the screen.

Wrapping up

Basic HTML code for students is a small language doing an honest job. Ten tags, one file, no installation, and a real page in a browser by the end of the first sitting. Teach the meaning-carrying tags from the start, expect the three classic errors, and let the child build something they actually care about rather than a replica of someone else's page. Then be clear about the limit: HTML describes content, and the day your child wants the page to do something, that is a different language and a good moment to move on.

Codeyoung runs 1:1 live online classes for children aged 6 to 17, with a teacher who adapts the pace to your child rather than a fixed syllabus. The first class is free, so you can see how they respond before deciding.

Book a Free Trial

Frequently Asked Questions

Is HTML a programming language?
No. HTML is a markup language: it describes what content is, not what a computer should do. There are no loops, conditions or variables in it. That is not a criticism. It is the reason a child can produce a working page on day one, long before they could write a program.
What age can a child start learning HTML?
Around 9 or 10 works well, once a child reads fluently and types with reasonable accuracy. Younger children can copy a page successfully, but HTML rewards careful spelling and matching pairs of tags, so it suits a child who can already handle precise text.
What software do you need to write HTML?
None beyond a text editor and a browser, both already on the computer. Save a plain text file with a .html ending and open it in a browser. Nothing to install and nothing to sign up for is the single biggest advantage HTML has as a first step.
How many HTML tags does a beginner need?
About ten. Headings, paragraphs, links, images, lists, and a few structural tags cover the large majority of real pages. Tutorials that list eighty tags teach copying rather than understanding, and a child who knows ten tags well can build more than one who has seen eighty once.
Should my child learn HTML before Python or Scratch?
It depends what they want to make. A child who wants a website should start with HTML. A child who wants games, animation or anything with rules and logic should start with blocks or Python, because HTML cannot express logic at all and months spent on it will not move them closer.
What is the difference between strong and b in HTML?
Both usually look bold. The strong tag means the text matters, so screen readers and search engines treat it as important, while b only asks for bold pixels. Teaching meaning-first tags from the start avoids a habit that has to be unlearned later.

Turn your child’s curiosity into creativity 🚀

Book a free 1:1 trial class and see how Codeyoung makes learning fun and effective.

Arpita Jain

Arpita Jain
I head curriculum design for Codeyoung's coding program. For the last 10+ years, I've built K-12 computer science curricula, and today I oversee the Scratch-through-Python pathway that thousands of Codeyoung kids learn on. The question I care about most is the one every parent eventually asks: what should my kid actually be learning at each age, and in what order? Too much kids' coding rushes children into typing real code before they're ready — and they bounce off it. I built our age-banded curriculum to do the opposite: logic and confidence first, with visual block coding, then real syntax once a child is genuinely ready for it.

Codeyoung Perspectives

Codeyoung Perspectives is a thought space where educators, parents, and innovators explore ideas shaping how children learn in the digital age. From coding and creativity to strong foundational math, critical thinking and future skills, we share insights, stories, and expert opinions to inspire better learning experiences for every child.