Html Comments element is used to add a comment to an HTML document. An HTML comment begins with <!–– and the comment closes with ––>. Comments are visible to anyone that views the page source code, but are not rendered when the HTML document is rendered by a browser.
You will be able to see this text. You can even comment out things in a sentence. Another thing you can do is put comments after closing tags, to help you find where a particular element ends.
(This can be helpful if you have a lot of nested elements.)
The Comment tag is used to insert a comment in the HTML Source Code.
- A Comment will be ignored by the browser.
- The Comment starts with the tag “<!– ” and ends with “–>”.
- we can use comments to explain our code, which can help anyone who likes to edit the source code at a later date.
Code for Comments in html:
Output for Comments in html:
Note: The Output is blank because, we Commented the content.