HTML comment

Updated: 10/11/2017 by Computer Hope

HTML comment tagWhen writing in HTML, the <!--comment--> tag is used to write remarks into the source code. HTML comments can be useful for explaining code while not being 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 code

<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