Open In App

How to write comments in HTML ?

Last Updated : 31 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we have to pass a comment for an HTML by using <!– Comment –> tag. In html, we can add single-line comments and multi-line comments. These are used to insert comments in the HTML code. It is helpful to understand complex code. The comment tag is useful during the debugging of the codes.
Syntax: Single line comment

<!-- Comments here -->

Syntax: Multi line comment

<!-- 
 This is 
multi line
comments. 
-->

Example: The following code illustrates a single line comment.




<!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>


Output:

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




<!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 lines
            
        Paragraph element  -->
            
     
<p>GeeksforGeeks </p>
 
 
     
<p>
        It is a Good platform For
        Computer science students
    </p>
 
</body>
  
</html>


Output:



Similar Reads

How to write comments in PHP ?
In this article, we have to pass a comment for PHP code by using some simple basic syntax. Comments are helpful to understand the complex code. The comment tag is useful during the debugging of the codes. We use comments to understand the functionality of the code. Basically, the single-line comments begin with // comments. Example 1: C/C++ Code
1 min read
How to write comments in ReactJS ?
To write comments in React JS we use the javascript comments and JSX object. It helps in adding useful information about the code and comment-out and ignore the extra code in the program. Writing comments in React is done in these ways. Table of Content Using JavaScript commentsUsing JSX objectSteps to create React ApplicationStep 1: Create a React
3 min read
Design a Nested Chat Comments using HTML CSS and JavaScript
In this article, we will learn how to create Nested Comments using JavaScript. We must have seen it on social media like Facebook, Instagram, Youtube, Twitter, etc. We have seen the use of the nested comment in the comment section of these social sites. Approach: Create a folder nested-comments on your local machine and go to that folder.Create 3 f
2 min read
HTML Comments
HTML comments are an very important for developers, providing a way to annotate code without affecting the rendered webpage. HTML Comments enhance code readability, facilitate collaboration, and can be used to temporarily disable code segments. Enclosed within &lt;!– and –&gt;, HTML comments serve as invisible notes within the code. What are HTML C
2 min read
How to auto like all the comments on a facebook post using JavaScript ?
In this article, we are going to learn how to like all the comments on a Facebook post automatically. Many times we want to like all the comments of friends on our post or on any other's post, so this script helps us to save time and effort by automatically liking all the comments on the post. Approach: Make variable comments that points to an arra
2 min read
SASS | Comments
Comments in SASS is very similar to the comments in any other programming language. But the difference comes when we talk about the type of comments will be there in the compiled CSS file. There are two types of comments in Sass: Silent Comments: Silent comments are single-line comments. When we compile Sass file these comments don't reflect in com
1 min read
How to block comments in YAML ?
YAML is a human-friendly data serialization standard for all programming languages. It is commonly used for configuration files and in applications where data is being stored or transmitted. The Normal Way for commenting in YAML is Inline commenting with the "#" symbol, however, if you want to comment blocks then we have a list of ways in which it
2 min read
YAML Comments
[caption width="800"]YAML_Comments[/caption] Comments are used to prevent the execution of statements. Comments are ignored while the compiler executes the code. Comments are user-friendly as user can get explanations of code using comments. Since you are alright with the sentence structure and fundamentals of YAML, let us continue further into its
3 min read
Integrating Facebook Comments Plugin in Django Project
Django is a Python-based web framework that allows you to quickly create efficient web applications. It is also called batteries included framework because Django provides built-in features for everything including Django Admin Interface, default database – SQLlite3, etc. In this article, we will learn to integrate the Facebook comment plugin in Dj
2 min read
Documentation Comments in JSDoc
In JSDoc we need to include documentation comments in the code through which JSDoc will generate an HTML documentation website. Let's see how to create documentation comments for different types of code. String, Numbers &amp; Arrays: C/C++ Code /** * Site Name * @type {string} */ const siteName = &quot;GeeksForGeeks&quot;; /** * Number * @type {num
4 min read