Span: the inline container
A generic inline container with no built-in styling. Used to wrap part of a text flow so CSS can target and style that portion of the text.
Understanding Span: the inline container in HTML & CSS
What it does: <span> wraps '$42' without breaking the paragraph. The price stays inside the sentence flow. id="badge" gives this span a unique hook for CSS. Without CSS, <span> renders exactly like the surrounding text. <span> has no built-in visual styling. All appearance must be added with CSS targeting its class or id. <span> is an inline element - it must live inside a block container like <p>, <h1>, or <li>. HTML tag names must be lowercase. <SPAN> is non-standard - use <span>. <span> does not break the line. class="name" lets CSS apply colour, font weight, or any style to just that word.
Common mistakes: HTML tag names must be lowercase. <SPAN> should be written as <span>. The span closing tag is missing its forward slash. It should be </span> not <span> at the end.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 11–21) and crossword (Modules 21–30) and word search (Modules 1–23) and word search (Modules 21–41).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
<span>Fill in the Blanks
Spot the Error
Student with a class code? Join your class →