Div: the block container
A generic block-level container element with no built-in styling. Used to group content so CSS can target and style sections of a page.
What it does: The <div> wraps the heading and paragraph into one group. CSS targeting .hero applies styling to the whole block. id="sidebar" uniquely identifies this div. CSS can use #sidebar { } to position and style this block. <div> has no built-in visual styling. It is a neutral container - all styling must be added with CSS. <div> is block-level - it starts on a new line and expands to fill its parent's full width. Use <span> for inline grouping. class is the standard attribute for linking a div to CSS rules. Using inline style is possible but less maintainable. Nesting divs inside divs is a common pattern for building layout grids, cards, and other structured designs.
Common mistakes: HTML tag names must be lowercase. <DIV> should be written as <div>. The h1 closing tag is missing its forward slash. It should be </h1> not <h1>.
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.
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
<div>Fill in the Blanks
Spot the Error
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.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →