HTML: How to Comment With Example

In this article HTML How to Comment we discussed How to comment out in HTML?, HTML comment syntax, and two or more examples where we use HTML comment in the document.

Basically, comments are helpful for web developers or designers to know about source code working which is encapsulated with some information about code using Comment Tag by any developer.

how to comment in html

Here are the details which we discuss in this article,

  • Major points about HTML Comment Tag
  • HTML: How to Comment with Example
  • Browser Support

Major points about HTML Comment Tag

  1. The <!--...--> is an HTML Comment Tag.
  2. When you place content or information between <!--...--> this tag browser would not show these pieces of information.
  3. Developers can also hide the script tag code using HTML comments.
  4. Comment out HTML allows developers to leave notes or information about source code.

Also Read: How to Include Comments in CSS

HTML: How to Comment with Example

The HTML comment encapsulate the piece of information by using comment tag.


Single Line Comment

Multiline Comment

Sometimes we need to comment out multiple lines or some lines of code, then we use multiline comment.

You can also comment out or hide script code which is define inside <script> tag.


Note: You may also see <comment> tag somewhere but that comment tag is not supported by modern browsers.

Supported Browsers

Chrome (1+)

Edge (All)

Firefox (1+)

IE (All)

Opera (All)

Safari (All)

Here is the complete explanation HTML Comment.

Also, Read

Happy Coding..!

Was this article helpful?
My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH. I am a web Programmer by profession and working on more than 50 projects to date. Currently I am working on the web-based project and all the CMS and frameworks which are based on PHP.
Posts created 188

Leave a Reply

Your email address will not be published.

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top