HTML Comments

 



While HTML comments are not visible in the browser, they will aid in the documentation of your HTML source code.


HTML Tags for Comments

Use the following syntax to add comments to your HTML source:

<!-- Write your comments here -->
Notice that the start tag has an exclamation point (!) but the end tag does not.

The browser does not show comments, but they can help you record your HTML source code.

You can use comments to add updates and reminders to your HTML code:

Example

<!-- This is a comment -->

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

<!-- Remember to add more information here -->
Since you can comment out HTML lines of code one at a time to look for errors, comments are also useful for debugging HTML:

Example

<!-- Do not display this image at the moment
<img border="0" src="pic_trulli.jpg" alt="Trulli">
-->

Post a Comment

0 Comments