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 Comments |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| How to add comments in HTML? |