Since HTML is officially an SGML application, the comment syntax used in HTML documents is the same as the SGML comment syntax:
A comment declaration starts withThis means that the following are all legal SGML comments:<!, followed by zero or more comments, followed by>. A comment starts and ends with "--", and does not contain any occurrence of "--".
<!-- Hello -->
<!-- Hello -- -- Hello-->
<!---->
<!------ Hello -->
<!>
--" characters, should
always have a multiple of four "-" characters to be legal.
(<!> is also a legal comment - it's the empty comment).
Use the following simple rule to compose valid and accepted comments:
An HTML comment begins with "<!--", ends with "-->" and does not contain "--" or ">" anywhere in the comment.