HTML comments
An HTML comment - text placed between <!-- and --> is ignored by the browser and never shown on the page.
What it does: Every HTML comment must begin with <!-- and end with -->. Anything in between is the comment text. The comment appears in the HTML file and can be read by anyone who views the source, but it is never rendered on the page. Content inside <!-- --> is ignored by the browser and never shown to the user. // is used for comments in JavaScript, not HTML. HTML comments always use <!-- and -->. HTML comments can span multiple lines - everything between <!-- and --> is commented out, regardless of line breaks. Nested comments are not valid HTML. The first --> encountered closes the comment, even if there is an inner <!--.
Common mistakes: The comment opening marker must be <!-- with no spaces between < and !--. Writing <! -- is invalid syntax. The opening comment marker must be <!-- with two hyphens. Writing <!- with only one hyphen is invalid syntax.
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
<!-- -->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 →