HTML Comment Tag | Comment in HTML

HTML Comment Tag

HTML Comment Tag is used to make a part of code which is ignored by the web browser. And browser will not display that part of code but the code is visible in the code section.

Comment in HTML syntax

 <!-- Put Your Comments Here --> 

The main use of HTML comment in code is to create the section and give a proper information about the code while debugging or any other work to the code.

How can you actually use the comment in HTML with other code

<!-- DOCTYPE -->
<html>
   <head>
      <!-- Title of the web page -->
      <title>My Web Page</title>

   </head>

   <body>
      <!-- Heading of the Web Page -->
      <h2>Heading</h2>

      <!-- Paragraph of the Web Page -->
      <p>Paragraph</p>

   </body>
<html>

This syntax shows that how you use the comment in correct way. And the result of this code does not content the comment part after the execution in the browser. You can see this result in the below image.

HTML Comment Tag Comment in HTML
Fig.1 – HTML Comment Tag Or Comment in HTML.

HTML Single line Comment

HTML does not support any Single line Comment syntax. Although Many other languages support Single line Comment, but single line comment in HTML is not defined.

You can leave a response, or trackback from your own site.

2 Responses to “HTML Comment Tag | Comment in HTML”

  1. Great weblog right here! Additionally your web site a lot up fast! What host are you the usage of? Can I get your associate link in your host? I desire my site loaded up as fast as yours lol

  2. Google says:

    We came across a cool web page that you could delight in. Take a appear when you want.

Leave a Reply to the article

Learning & Certifications
Follow Us
Facebook Icon   Linked In Icon   Twitter Icon  
Validation and Recognition

Valid CSS! Valid HTML5!

Powered by Wordpress