HTML Comments

HTML Comments

Comments are useful information about the HTML elements. Comments makes the HTML document more readable and understandable.

Comments are ignored by the browser and are not displayed. Comments start with <!-- and end with -->. There is an exclamation mark after the opening bracket, but not before the closing bracket.


<!-- This is a comment--> 

The content between >!-- and --< is comments. The browser will just ignore it.

The following html document has a comment.


<!DOCTYPE HTML>
<html> 
<body> 
<!-- This is a comment. --> 
<p>This is a regular paragraph</p> 
</body> <!-- ww w. j  a  v  a  2  s . c  om-->
</html> 

Click to view the demo

The code above generates the following result.

HTML Comments