Welcome to Our Free Tutorial!

HTML Comments


Comments are a part of the HTML code and is used for explain the code.

It is useful for yourself if you have revisite the code in many month or years.

Comments are not visible or displayed on the browser. It is simply programmer benifits.

You write comments like this:

< !-- Write your comment here -->

Comments always start with <!-- and end with --> . This tells the browser when a comment Starts and ends. In html you can use this type of comment tag

Example Comment Code:

<html>
<head>
<title>html Comment Tag</title>
</head>
<body>
<!-- Display a Globle image -->
<img src="Path of the image" width="100" height="100" alt="Internet Image" />
</body>
<!--and end with html closing tag.-->
</html>

This results in:

The above mention comment code show the image in your browser but not show in comment text. This is Comment tag in html, it is important for explanation of typical code. Internet Image