HTML Comment tags are used to insert some useful comments in the HTML document.
Anything you write inside Comment tags will be ignored by the web browser and it will not show any output to the user. Comments are very helpful for programmers. Using HTML Comments, you can add some useful descriptions of some code. They help you understand your code and increase code readability later.
Example of Comment tag:
<!-- This is a sample comment -->
<!-- Add any comment about the following paragraph --> <p>This is a first paragraph.</p> <!-- This comment will tell something about the following paragraph --> <p>This is another paragraph for testing.</p>
Complete HTML Program with Multi-line HTML Comments
You can simply use multiple lines to add large comments using the same tags. See the multi-line comment example below:
<html> <head> <title>Multiline Comments Testing</title> </head> <body> <!-- This is a multiline comment and you can add some description about the following code so that it will be helpful to others. --> <p>This is some sample text.</p> </body> </html>
Conditional comments define HTML tags to be executed by Internet Explorer only.
<!--[if IE 8]> .... some HTML or code here only for Internet Explorer... <![endif]-->