HTML Comments
The HTML comments are not be displayed by the browser. It may be used for informational messages for developers as well as to mask content from user agents that do not support a particular technology.
HTML Comment Tags
The following syntax:
<!-- Comment Goes Here -->
No attributes or events are associated with this construct.
Notes:
- Comments often are used to exclude content from older browsers, particularly those that do not understand client-side scripting or style sheets.
- Developers should be careful when commenting markup Language to ensure that other comments are not included or that two dashes (
--) are not embedded in the content commented.
Singleline Comments
You can add single line comments.
Example
<!-- This is a comment -->
<p>Paragraph of the page.</p>
<!--p>This paragraph is commented.</p-->
Advertisement
Multiline Comments
HTML supports multi-line comments as well. You can comment multiple lines by the special beginning tag placed before the first line and end of the last line as shown in the given example below.
Example
<!-- This is multiline comment
<p>Paragraph of the page.</p>
-->
A complete list of all HTML tags, see HTML Tag Reference.