If you want to comment on any part of your HTML document, then this content will not be displayed in the browser. If any other developer or you look at that document a lot later, it is easy to understand what code you wrote So it’s not important to make good comments on the code. All comments contained in start tag <! – and end tag -> are hidden. Such as

<!-- menu section -->
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
</ul>

<!-- comment block -->

<div id="comment">

<p>There are few browsers who supports <comment> tag to comment a part of code.</p>
</div>

You can also comment multiple lines at once. Thus the main purpose of the comment is to create a documentation for the code so that the code can be understood later for any part of it.

<!-- 
This part will effect only 320px on responsive view.This is not for large desktop

-->
<div id="col-lg-5 col-md-5 col-sm-5">
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
</ul>

</div>

Conditional comments can also be done, it only works for Internet Explorer. For example, we use additional scripts or CSS files for IE. Such as

<!--[if lt IE 9]>
<script src="/media/jui/js/html5.js"></script>
 <![endif]-->

It will only work for IE 9.

If you put any code inside the comment tag it will not show in the browser, before any of the above two versions of the code, <! – and -> run through the browser, do not show that part.