HTML comment

Updated: 11/13/2018 by Computer Hope
HTML comment tag

When writing in HTML (hypertext markup language), the <!--comment--> tag is used to write remarks into the source code. HTML comments can be useful for explaining code that isn't displayed or read by the browser. The following sections contain information about this tag, including an example of it in use and browser compatibility.

Example of a comment in HTML

<p>Hey, I'm a paragraph with some text in me.</p>

<!-- And I'm a comment about the paragraph that's only visible in
 source code.-->

Example result

Hey, I'm a paragraph with some text in me.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All versions All versions

Browser, Compatibility, HTML !DOCTYPE, Nonexecutable statement, Paragraph, Web design terms