Filter (Advanced Search)
Downloads
3
Views
501
Video

Comments | Comments

Details

The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.

Comments are some text or code written in your code to give an explanation about the code, and not visible to the user. Comments which are used for HTML file are known as HTML comments. Anything written between these tags will be ignored by the browser, so comments will not be visible on the webpage.


HTML Comment Tag

You can add comments to your HTML source by using the following syntax:

<!-- Write your comments here -->

Notice that there is an exclamation point (!) in the start tag, but not in the end tag.


<!DOCTYPE html>
<html>
<head>
<title>Comments</title>
</head>    
<body>
<h2>HTML Comments</h2>
<!-- Single Line Comment -->

<!--
<p>Multiline Comment:</p>
<img border="0" src="/media/images/cat.jpg" alt="cat">
-->
<p>GSSS KHOKHAR</p>

<p>GSSS <!-- KHOKHAR --> Sri Muktsar Sahib.</p>


</body>
</html>

 


Output


Note: Comments are not displayed by the browser, but they can help document your HTML source code.

Ad