KS3 · Computer Science
Introduction to HTML
Every web page you've ever scrolled through started as a plain text file: words wrapped in little labels like <h1> and <p>. Today you write the labels.
Computer Science · Structure
A web page is a tree of boxes
Each line joins an element to the element it sits inside. Tap any box to find out what it's for.
Tap any part of the diagram to see what it does.
Predict, then check
Read the file like a browser would: head first, then body.
A browser opens this file: <!DOCTYPE html> <html> <head> <title>Pond Life</title> </head> <body> <h1>Frogs</h1> <ol> <li>Spawn</li> <li>Tadpole</li> <li>Frog</li> </ol> </body> </html>. What do you see?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
HTML doesn't draw a page. It labels what each part is, and the browser does the drawing.
What you need to know
- A web page is a text file written in HTML (HyperText Markup Language), a markup language that labels what each part is.
- A web browser reads that HTML and displays, or renders, the page you actually see.
- Tags sit inside angle brackets, and a closing tag adds a forward slash: <p> opens, </p> closes.
- An element is the whole package: opening tag, content and closing tag together.
Have a goCount them up. In <h2>Goals</h2>, how many tags are there, and how many elements?
Two tags (<h2> and </h2>), but just one element.
It's tempting to count each tag as its own element, but the element is the whole package: both tags plus the content they wrap.
- Every page starts with <!DOCTYPE html>, then an <html> element holding a <head> and a <body>.
- The head holds information about the page, like the <title> in the browser tab; the body holds what appears on the page.
Have a goYour mate wants 'My Epic Skate Page' to show in the browser tab, so they proudly type it as a big heading in the body. Where should it really go?
In a <title> inside the <head>.
A heading in the body appears on the page; the tab text is information about the page, so it belongs in the title, in the head.
- Everyday elements: <h1> down to <h6> for headings, <p> for paragraphs, <a> for links, <img> for images, and <ul> or <ol> with <li> items.
- Attributes go inside the opening tag and add extra information, such as href, src and alt.
- Nested elements close in reverse order: whatever you opened last, you close first.
Have a goYou type <html>, then <body>, then <p>. Which closing tag do you write first?
</p>
</html> feels right because it came first, but the box you opened first is the outermost one, so it shuts last.
- Hyperlinks join pages into the World Wide Web, while colours, fonts and layout are usually CSS's job.
The big picture
A web page is a text file written in HTML (HyperText Markup Language). HTML is a markup language: it describes a page's structure and content by wrapping each part in tags, and a web browser reads it and displays the page. Elements sit inside other elements (a head and a body inside html), and nested tags close in the reverse order to the one they were opened in.
Key points
Worked example
Problem
Write the HTML for a page about a school chess club. The browser tab should say Chess Club. On the page there should be a main heading Chess Club, a paragraph saying We meet on Fridays., and a picture from the file board.jpg, described as A chessboard for anyone who can't see it.
⚠ Watch out
Closing tags in the same order you opened them, like <p>Visit <a href="games.html">my games</p></a>. The <a> was opened last, so it has to close first: <p>Visit <a href="games.html">my games</a></p>.
Memory hook
Think of nesting dolls. You can't close the big doll until the small one inside it is shut. Last opened, first closed.
Check yourself
Cover the page and write an HTML skeleton from memory: doctype, then <html> holding a <head> (with a <title>) and a <body>. Is every tag closed, last-opened first?
Flashcards
(15)What is HTML?
What does a web browser do with an HTML file?
What is the difference between a tag and an element?
How is a closing tag written differently from an opening tag?
What is the first line of an HTML document?
Which part of an HTML page describes the page rather than appearing on it?
What goes in the <body>?
Which heading is the most important: <h1> or <h6>?
<ul> or <ol>: which gives a numbered list?
What does the href attribute on a link give?
What do src and alt give on an image?
Name a common element with no closing tag.
In what order do nested tags close?
What makes the World Wide Web a 'web'?
What usually controls a page's colours, fonts and layout?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore KS3 Computer Science topics
How this lesson was checked. This KS3 Computer Sciencelesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.