Menu
Coddy logo textTech

Comments in HTML

Part of the Fundamentals section of Coddy's HTML journey — lesson 5 of 60.

Comments are notes in the code that don't appear on the web page. They are useful for:

  • Explaining complex code
  • Leaving notes for yourself or others
  • Temporarily disabling code

In HTML, comments are written between <!-- and -->

Here's an example:

<!-- This is a comment -->
<p>This is a paragraph.</p>
challenge icon

Challenge

Easy

Add a comment inside the <body> tag with your name and today's date.

Cheat sheet

Comments in HTML are written between <!-- and --> and don't appear on the web page:

<!-- This is a comment -->
<p>This is a paragraph.</p>

Comments are useful for explaining code, leaving notes, or temporarily disabling code.

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <p>The comment goes below this paragraph</p>
        
    </body>
</html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals