HTML Comments

Comments are those text or code written in a code that are not visible to the user, but are used to provide an explanation about the code to make a code code easy to understand and to increase its readability. To insert comments in the source code in HTML, the Comment tags are used.

Syntax:

<!-- Comments -->

Example:

<!DOCTYPE html>
<html>
<body>
<!-- HTML Paragraph tag -->
<p>Hello World!!</p>
</body>
</html>

Output:

Hello World!!

Explanation:
In the above example, comments are added in the code to make the code easy to understand but comments are not displayed on the browser.

Multiline Comments:

The same syntax can be used for both single line and multiple line comments in HTML.
Example:

<!DOCTYPE html>
<html>
<body>
<!-- This is an example to display
a text on browser using HTML. 
HTML Paragraph tag -->
<p>Hello World!!</p>
</body>
</html>

Output:

Hello World!!

Explanation:
In the above example, comments are added in the code to make the code easy to understand but comments are not displayed on the browser.

Please Share