HTML Comment

HTML Comment does not show on the web browser but it helps us in the timing of documentation if we keep any information inside the HTML comments tag, then ignores that information in the web browser.

Example

<!-- This is a comment -->

<p>This is a paragraph.</p>

<!-- This is a comment -->

One comment can not be placed within other one comment.

The ability to understand code through comments increases. Friends, you can also write specific information inside the comments. In this case, they will not appear on the web document and will not show up for the user.

Types of Comment

  • Single Comments
  • Multiline Comments
  • Conditional Comments

Single Comments Example

<!DOCTYPE html>
<html>
<body>
<!-- This Is Single Line Comment -->
<p>This is My paragraph</p>
</body>
</html>

Multiline Comments Example

<!DOCTYPE html>
<html>
<body>
<!-- This 
Is 
Multiple Line Comment -->
<p>This is My paragraph</p>
</body>
</html>

HTML Conditional Comments Example

<link href="everything.css" rel="stylesheet">
<!--[if IE]><link href="stupidie.css" rel="stylesheet"><![endif]-->