info@tutsfinder.in



HTML Comments



Comments is a piece of code which increases the code readability and help the user to understand you code easily. Comment is not visible when the code is run on web browser.

It is always a good practice to mention the comments in your code which also indicates the section of every document, specially if the code is complex then it make easier to read the code.


Syntax for Comment:
<!--..-->

Any content place in between the indicates the comment and ignored by the browser.



Example
<!DOCTYPE html>
<html>
<head><!—Heading of document-- >
</head><!—Heading of document ends-->
<body>
<p> Document content </p>
</body>
</html>


Types of Comments:

• Valid and Invalid Comments

• Multiline Comments- we can have multiple line of comments in our HTML document.

• Conditional Comments