Back to the html tags list

HTML <!-- comment --> Tag

The <!--comment--> tag is used to make hidden comments in html. This tag is great for showing where you are in your html code. Like "<!--Start navigation-->" for the start of your navigation code.

Where/how To Use The <!-- Comment --> Tag

Use in head or body section? Anywhere inside a HTML document
Inline or Block level tag? No level
HTML Tag Syntax? <!-- CONTENT -->
XHTML Tag Syntax? <!-- CONTENT -->

Example

Code Output
<!-- Hello this is a comment -->
<h3>Hello this is a normal h3 heading</h3>

Hello this is a normal h3 heading


Notes

  • A comment is ignored by the browser. So you will only be able to see the comment in the source code

  • Comments can also hide code that you do not want the user to see at the apparent moment.


Back to the html tags list