- In HTML, comments are basically use to insert comments in the HTML document.
- Comments are very helpful for develpers to identify the source code of the program.
- Comments are not show on the browser at the time of run the HTML program.
We can declare Comments In HTML By using the following syntax..
<!-- Code Family --> In the above syntax we start HTML comment by using exclamation sign(!) and we are not using any closing symbol because it's close automatically.<!DOCTYPE html>
<html>
<head>
<title>HTML Comments</title>
</head>
<body>
<!-- This is a comment -->
<h1>Code Family</h1>
<!-- This is a comment -->
</body>
</html>
Multiline Comments
In HTML we can also comment multiple lines at the same time. In HTML we comment multiple lines by using <!-- Opening tagand --> closing tag.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Multiline Comments</title>
</head>
<body>
<!--
<h1>Code Family</h1>
<h2>Code Family</h2>
<h3>Code Family</h3>
<h4>Code Family</h4>
-->
</body>
</html>