HTML Comments

Comments are those parts of HTML document that are ignored by every web browser.We generally add comments for simplicity from coders point of view so that we can understand what a particular HTML part is about.

Method of writting HTML comments

<!---- Place your comment here --->


<!DOCTYPE html>
Description of comments </title>
<!---- Place your comment here ---->
<h3>This is heading.</h3>
<p>This is paragraph.</p>


This is heading.

This is paragraph.

Types of comments

  1. Valid Comments-comments written in way <!---- Your Code ----->
  2. Invalid Comments-comments leave some space before !.


  • Conditional Comments-These comments describes such HTML documents that are executed by Internet Explorer only.
  • Software program Comments