HTML Comments


HTML comments can be used to document your HTML code because they are not shown by the browser.


HTML Comment Tags

You can add comments to your HTML code by using the following syntax:

<!-- Write your comments here -->

Notice that there is an exclamation point in the opening tag, but not the closing tag.

Please Note: HTML comments are not displayed by the browser!

Using comments, you can place reminders and notifications in your HTML code:

<!-- This is a comment -->

<p>This is a paragraph.</p>

<!-- Remember to add more information here -->

Comments are also great because they allow you to comment out line of code, one at a time, to find an error.