HTML Comments:
- Comment tags <!– and –> are used to insert comments in HTML.
- Note: There is an exclamation point (!) in the opening tag, but not in the closing tag.
- Comments are not displayed by the browser, but they can help document your HTML.
- Using comments, we can provide description about HTML document.
- With comments you can place notifications and reminders in your HTML.
<!DOCTYPE html>
<html>
<body>
<!-- This is a comment -->
<p>This is a paragraph.</p>
<!-- Comments are not displayed in the browser -->
</body>
</html>
We can comment multiple lines, by which we can execute only blocks of code in the HTML document in the process of debugging.
<!DOCTYPE html>
<html>
<body>
<!-- Do not display this at the moment
<img border="0" src="cute.jpg" alt="small kid">
-->
</body>
</html>