HTML & CSS Wiki

READ MORE

HTML & CSS Wiki

This obsolete element is not recommended. Authors should generally find an alternative way to accomplish the same task while adhering to all best practices, or simply do without it if it is unimportant.



The HTML <comment></comment> element was used to insert a comment within an HTML document. Any content surrounded by this element will not be displayed on the webpage, but can still be seen when the source code is viewed. This element has become obsolete since HTML 2.0 and its use is not recommended. Instead, if authors wish to insert a comment, they should use <!-- -->.

Attributes[]

This element does not support any attributes.


Example:

<comment>This is a comment.</comment>

View the source code for this line of text and you will find the hidden comment.