HTML Comments

html comments

1HTML Comments

  • HTML comments are used to create remarks or documentation inside your code.
  • They are never displayed in the browser. Only visible in code.
  • They are also very helpful in debugging the code.

Programmers write comments along with code when the code becomes long and messy. Comments can help them as well as other programmers to understand the code.

Remember, html comments are written between <!-- and --> tags.

Comments are also useful in debugging or testing the code. You can simply comment out the portion of HTML code to avoid displaying in the browser.

In the example below I have commented out the second paragraph. Now, the browser will consider it as a comment and won’t display in the browser.


Please enter your comment!
Please enter your name here