Loading
HTML comments are pieces of text in your code that are not displayed in the browser but can be seen in the source code. They are mainly used to inset notes, explanations or disable section of code without deleting them. Comments are extremely helpful for both personal reference and collaborative development.

  • HTML comments do not appear on the webpage but can be seen in the page's source code.
  • They help document your code, making it easier to understand and maintain.
  • Comments can be use to
  1.   Explain complex logic
  2.   Leave notes for other developers
  3.   Temporarily disable code for testing
  4.    Assist in debugging by isolating problem areas
  • Search engines like Google ignore comments, so hey do not affect your SEO directly but they improve code clarity, which is crucial for long-term success.
Syntax:
<!-- Write your comments here -->

Example:

<!DOCTYPE html>
<html>
 <body>
  <!-- This is a comment -->
  <p>This is a paragraph.</p>
  <!-- Comments are not displayed in the browser -->
 </body>
</html>

Output:
Uploaded Image