HTMLWeb DevelopmentFront End Technology

HTML comments are placed in between <!-- ... --> tags. So, any content placed with-in <!-- ... --> tags will be treated as comment and will be completely ignored by the browser.

## Example

Let us see an example of single-line comments in HTML −

Live Demo

<!DOCTYPE html>
<html>
<title>This is document title</title>
<body>
<p>Document content goes here.....</p>
</body>
</html>

## Output

This will produce the following output. The text in the comments never gets printed −

## Example

We can also set multi-line comments in HTML. Let us see an example −

Live Demo

<!DOCTYPE html>
<html>
<title>This is document title</title>
<body>
<!--
This is a multiline comment and it can
span through as many as lines you like.
-->
<p>Document content goes here.....</p>
<p>We have set comments in the document as well, but it won't get displayed.</p>
</body>
</html>

## Output

This will produce the following output. The text in the multi-line comment won’t get displayed −

Published on 17-Sep-2019 08:54:12