Web Analytics

HTML Comments

Beginner ~3 min read

Adding Comments

Comments are pieces of code that are ignored by the browser. They are not displayed on the page.

You can use comments to explain your code, which can help you or others understand it later.

<!-- This is a comment -->
HTML
CSS
JS

Debugging with Comments

You can also use comments to "hide" parts of your HTML code temporarily while you are testing or debugging.

Quick Quiz

How do you write a comment in HTML?

A
// This is a comment
B
/* This is a comment */
C
D
This is a comment