HTML comments are not shown in the browser, but they can help document your HTML source code.
Comments are some text or code written in your code to give a clarification about the code, and not apparent to the user. Comments which are used for HTML file are known as HTML comments. Anything written between these tags will be ignored by the browser, so comments won’t be visible on the webpage.
Comments of any code make code straightforward and increment readability of code.
Comments are additionally part of the code, which gives a clarification of the code.
HTML Comment Tags
You can add comments to your HTMLsource by using the accompanying syntax:
<!-- Write your comments here -->
Notice that there is an exclamation point (!) in the start tag, but not in the end tag.
Note: Comments are not displayed by the browser, but they can help document your HTMLsource code.
With comments you can put notices and reminders in your HTMLcode:
<!-- This is a comment --> <p>This is a paragraph.</p> <!-- Remember to add more information here -->
Comments are additionally great for debugging HTML,since you can comment out HTMLlines of code, each in turn, to look for errors:
<!-- Do not display this image at the moment <img border="0" src="pic_mountain.jpg" alt="Mountain"> -->
Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your photos and creative projects with us.