Skip to main content

HTML Comments | Comment Tags in HTML

HTML comments are used to add notes or explanations to the HTML code that are not displayed in the web page.

They are often used by web developers to provide context for the code.

Comments are created using the <!-- and --> tags.

Here is an example of how to create an HTML comment:

Editor

Loading...
Do not to overuse comments

Too many comments can make your code difficult to read. Only use comments when they are necessary to explain your code or provide context.

Hide Inline Content

To hide inline content in HTML using a comment, you can wrap the content you want to hide inside an HTML comment tag.

As an example:

Editor

Loading...