Basic HTML

Advance HTML

HTML Tags Reference

HTML Code Generator

HTML Resource

HTML Comment




Definition and Usage

HTML comment tag use to insert a comment into a source code. It's good habit to write a comment into a source code to improve user readability and understands.

You can also write a specify information inside comments. In this case they will not be display on web document and not visible for the user.

A good habit is write comment text inside html pages, scripts and style elements.

Comment Tag does not support any Standard Attributes.

HTML Comment Example-Code:

An HTML comment begins with "<!--", ends with "-->".

<body>
 <img src="jix/jnj.png" width="365" height="86" />  <!--Image File-->
</body>

CSS Comment Example-Code:

A CSS comment start with "/*" and ends with "*/".

/* h4 Heading style */ 
h4 {
   text-align:center;
   color:purple; /* Font Color is purple */
   font-family:verdana;
   }

JavaScript Comment Example-Code:

Single line comments start with //.

Multi line comments start with /* and end with */.

<script type="text/javascript">
// start heading h3
document.write("<h1>This is a heading h3</h1>");
/*
The fist code is use to h3 heading
or line break
*/
document.write("<h1>This is a heading</h1>"+"<br />");