How to add comments in HTML?

Write the comment between <!-- and -->. The browser ignores it and does not show it on the page.

<!-- This is a single-line comment -->
<h1>Welcome</h1>

<!--
  This is a
  multi-line comment
-->

You can also use a comment to switch off a piece of code for a while. In most editors the shortcut is Ctrl + /.

Comments are not secret, because anyone can see them in “View page source”. Do not write passwords in them. Learn more in HTML Comments.


Learn more about the similar topics:
Tutorials
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Comments
HTML Symbols
Exercises & Assignments
Program to see difference between paragraphs & normal text with line break
Write a program to create a webpage to print values 1 to 5
Write a program to create a webpage to print your city name in red color.
Write a program to print a paragraph with different font and color.
Write an HTML program to display all six heading levels
Write an HTML program for text formatting (bold, italic, subscript, superscript)
Interview Questions & Answers
How to add comments in HTML?
How to add the copyright symbol to a web page?
What is the difference between strong and b tag in HTML?
What are HTML entities?
What is the difference between inline, internal and external CSS?