HTML Comment
What is Comment in html?
HTML comments are not displayed in the browser, but they can help document your HTML source code.
Comments allow you to leave notes in your code for yourself or another developer.
HTML Comment syntax:
<! -- write your comment here -->
Notice that there is an exclamation point (!) in the start tag, but not in the end tag.
Let's see Example:
Add Comments in HTML Comment
With comments you can place notifications and reminders in your HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Comment Example</title>
</head>
<body>
<!-- This is a comment. It won't be displayed in the browser. -->
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text.</p>
<!-- You can add comments anywhere in your HTML code to provide explanations or notes. -->
</body>
</html>