← HTML & CSS

HTML elements: opening and closing tags

A closing tag - the forward slash before the tag name signals the end of an HTML element.

What it does: In this span element, 'My text' is the content sitting between the <span> opening tag and the </span> closing tag. The forward slash always comes before the tag name in a closing tag, like </p>. The closing tag must use the same tag name as the opening tag. <h2> is closed with </h2>, not </heading>. Without a forward slash, <p> is an opening tag. To end the paragraph element you need </p> with a slash.

Common mistakes: The opening h1 tag is malformed - it is missing the closing angle bracket >. It should be <h1> not <h1 title. The paragraph is closed with <div> instead of </p>. The closing tag must match the opening tag and use a forward slash.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which of these is a correctly formed closing tag?
</h1><h1/>
Matches
<p>Welcome<p>
The second tag should be </p> - using <p> again opens a new element instead of closing the first
Applying
Meanings
Term
</p>
Meaning
A closing tag - the forward slash before the tag name signals the end of an HTML element.
Practice
<div>
Testing
Gaps
<h1>Hello World
Check Answer
Spots
1<h1 title</h1>
2 <p>Some text</p>

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Arctic Hare' badge — Speed Indexer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which of these is a correctly formed closing tag?
A. </h1> ✓
B. <h1/>
A closing tag has a forward slash before the tag name: </h1>. The form <h1/> is not valid standard HTML for this element.
2. Where does the forward slash go in a closing tag?
A. Before the tag name: </p> ✓
B. After the tag name: <p/>
The forward slash always comes before the tag name in a closing tag, like </p>.
3. True or false: <div> and </p> are a correctly matched pair of tags.
A. False ✓
B. True
A closing tag must match its opening tag. </p> closes a <p> element, not a <div>.
4. Which line shows a complete HTML element with opening tag, content, and closing tag?
A. <p>Hello</p> ✓
B. <p>Hello<p>
<p>Hello</p> is correct - it opens with <p>, has content, and closes with </p>. The second option uses another opening tag instead of a closing tag.
5. True or false: content goes between the opening and closing tag.
A. True ✓
B. False
Content like text or other elements always goes between the opening tag and the closing tag.

Match the Pairs

<p>Hello</p> A complete paragraph element - opening tag, content, and matching closing tag
</h1> A closing tag - the forward slash before h1 signals the end of the heading element
Content goes between the opening and closing tag <span>My text</span>
A closing tag uses a forward slash before the tag name </div>
<p>Welcome<p> The second tag should be </p> - using <p> again opens a new element instead of closing the first
<h1>Title</h2> The closing tag name must match the opening tag - </h2> cannot close an <h1> element

Key Term

</p>
A closing tag - the forward slash before the tag name signals the end of an HTML element.

Fill in the Blanks

1. <h1>Hello World</h1>
Hint: Type the closing tag that matches the opening h1 tag
2. <div><p>My paragraph</p>
Hint: Type the opening tag for a div element
3. <p>Some text</p>
Hint: Type the closing tag that ends a paragraph element
4. <h2>Page Heading</h2>
Hint: Type the opening tag name that matches the closing h2 tag
5. <span>Bold text</span>
Hint: Type the closing tag that ends a span element

Spot the Error

Question 1
A <h1 title</h1>
B <p>Some text</p>
C <span>Label</span>
Line A — The opening h1 tag is malformed - it is missing the closing angle bracket >. It should be <h1> not <h1 title.
Question 2
A <div>
B <p>Hello there<div>
C <span>More</span>
D </div>
Line B — The paragraph is closed with <div> instead of </p>. The closing tag must match the opening tag and use a forward slash.
Question 3
A <section>
B <h1>Title</h1>
C <p>Content<section>
D </section>
Line C — The paragraph is closed with <section> instead of </p>. Closing tags must match their opening tag name and include a forward slash.
Question 4
A <div>
B <span>Label</span>
C <p>More text</p>
D <div>
Line D — The closing tag for div is written as <div> instead of </div>. A closing tag must have a forward slash before the tag name.
Question 5
A <article>
B <h2>Heading</h2>
C <p>First paragraph</p>
D <p>Second paragraph</p>
E <article>
Line E — The article element is closed with <article> instead of </article>. A closing tag requires a forward slash.
For Teachers

Create a free class, add this module to a journey, and track who's stuck.

Create a free teacher account →

No credit card. No setup fee. Make a class and invite students in under three minutes.

For Students

Practice this topic interactively, track progress, and unlock badges.

Start Learning Free →

Have a class code?