HTML <!--comment--> tag

You are Here:

HTML <!--comment--> tag

The <!--comment--> tag is used to add comments in the HTML code.

Comments aren't displayed in the browser. They are solely for your benefit.

Note: Any HTML tags inside <!--comment--> tag are treated as a normal text and are not displayed in the browser.

Tips: The <!--comment--> tag is useful for you to add explanations to your code that make it easier to remember what you were doing when you come back to your code later.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <!-- This is a comment. --> <p>This is a paragraph.</p> </body> </html>

Attributes

There is no special attributes for <!--comment--> tag.

More Examples

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <!-- This is a multiline comment. --> <p>This is a paragraph.</p> </body> </html>

SEO Tips

Comments should be reasonable in size because they do increase your file size and will have negative impact on SEO.

Web crawler will ignore all your content inside the comment tag.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author