Home > Abakada: Back to Basics > Language References > HTML Elements > HTML Comment Element
Prevents any enclosed content from being displayed. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<!-- ... explanatory notes ... -->
Comment tags in HTML are used to add explanatory notes to a document, which do not display in a browser but can provide useful information for human readers of the code.
They are used for documentation, to describe the purpose, functionality, or logic of a block of code, for noting historical changes in the code, and for temporarily disabling or hiding sections of HTML markup without necessarily removing them, among others.
Comments start with the string <!--
and end with the string -->
. Any content within are ignored and are not visible on the rendered page.
Comments can enhance the readability and maintainability of code, particularly for documents that are worked on by a team of developers.
The <comment>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following example shows how <comment
> tags may be used.
<!-- This text will not appear. -->