HTML Comments

HTML Tutorial

HTML Forms

HTML Graphics

HTML Media

HTML API

Html Comments

HTML Comment Tags

 Using the below syntax, you can add comments to your HTML source.

<!– Write your comments here –>

Add Comments

Comments can place notifications and reminders in the HTML code:

Example

				
					<!DOCTYPE html>
<html>
<body>
<!-- This is a comment -->
<p>This is a paragraph.</p>
<!-- Comments are not displayed in the browser -->
</body>
</html>

				
			

Output:

This is a paragraph.

Hide Contents

Comments are also useful if you want to hide the comment.

Hiding more than one line is also possible between the <!– and the –> will be hidden from the display.

Example

				
					<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<!--
<p>Look at this cool image:</p>
<img decoding="async" border="0" src="pic_trulli.jpg" alt="Trulli">
-->
<p>This is a paragraph too.</p>
</body>
</html>



				
			

Output:

This is a paragraph.

This is a paragraph too.

Hide Inline Content

Comments can also hide the parts in the middle of the HTML code.