How to write comments in HTML ?

In this article, we have to pass a comment for an HTML by using <!– Comment –> tag. This is used to insert comments in the HTML code. It is helpful to understand the complex code. The comment tag is useful during the debugging of the codes.
Syntax:

<!-- Comments here -->

Example: The following code illustrates a single line comment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<body>
    <h2>
        GeeksForGeeks
    </h2>
    <!-- single line comment -->
  
    <h2>
        HTML5: How to comment HTML tags?
  
    </h2>
    <!-- Paragraph element -->
    <p>GeeksforGeeks</p>
</body>
  
</html>

chevron_right


Output:

Example 2: The following code illustrates the multi line comment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>                                            
<html
   
<body
    <h2>
        GeeksForGeeks
    </h2>
        <!-- Multi line comment -->
    <h2>
        HTML5: How to comment HTML tags?
    </h2>
         
    <!-- The multi-line comment is useful 
        to comment multiple line 
             
        Paragraph element  -->
             
    <p>GeeksforGeeks </p>
  
    <p>
        It is a Good platform For 
        Computer science students
    </p>
</body
   
</html>

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.