HTML Comment - Syntax and Uses

HTML comments tag is somewhat important but it is not mandatory to add comments in an HTML documents (i.e. it is not compulsory ). Completely You can miss it. Adding Comments properly helps in finding class or sections in a large websites. They are added only for giving information to the given sentences or given paragraph.

Syntax of HTML Comment

<!--write your comments here -->

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> HTML Paragraph Learning </title>
</head>
<body>
<p> This is a paragraph. </p> <!-- end first para -->
<p> This is also an another paragraph. </p> <!-- end second para -->
</body>
</html>

Output

This is a paragraph.

This is also an another paragraph.

Points to be noted

1. Comments are not displayed on the web-browser and have no any effect on the visualization of web pages.
2. Generally, comment sections are green in color in the editor.

The caution you should be aware of is that Improper use of HTML comments may either disturb your page layout or let you miss some written texts in your documents. Therefore, be sure not to cover real HTML source code as shown in below:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> HTML Paragraph Learning </title>
</head>
<body>
<!-- end first para
<p> This is a paragraph. </p>
<p> This is also an another paragraph. </p>
end second para -->

</body>
</html>

There is no output for the above code because all the paragraphs are covered by comment section.
There is nothing more to be study in the HTML Comments.