Skip to main content

HTML Comments — exercises and bug fixes

5 hands-on exercises and 5 find-the-bug challenges for the HTML Comments lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.

Exercises(5)

  1. 1

    Add a comment above a heading

    easy10 min

    Add an HTML comment, then an h1 saying "Docs".

  2. 2

    Comment out an element

    easy10 min

    Keep only the paragraph visible; comment out the old heading.

  3. 3

    Label a section with a comment

    easy10 min

    Add a comment and a section containing a heading.

  4. 4

    Comment between two blocks

    easy10 min

    Add two paragraphs with a comment between them.

  5. 5

    Document an attribute choice

    medium10 min

    Add a comment explaining a link that opens in a new tab.

Find the bug(5)

  1. 1

    Fix the heading left inside a comment

    easy8 min

    The page title is commented out, so no heading renders.

  2. 2

    Fix the legacy conditional comment

    easy8 min

    The content sits inside a conditional comment, so modern browsers never render it.

  3. 3

    Fix the commented-out content

    easy8 min

    The paragraph that should show was commented out.

  4. 4

    Fix the TODO left in place of the heading

    easy8 min

    A comment stands where the real heading should be.

  5. 5

    Fix the paragraph commented out with the note

    easy8 min

    The note and the paragraph were commented out together.

Ready to write the code?

The editor, the automatic checks and the worked solutions open up with an account.

Open the workspace