TRENDING TOPICS

×

Comment tag in HTML

HTML comment tag is used to ignore a piece of HTML code being display in a web page. Commented codes are visible in source code but they are not rendered in web page.

When use comment tag?

  • To hide a piece of code.
  • To insert a reminder code text for future.
  • To hide code for temporary time, this code will be used in the future.

Exmaple of comment tag

Result Look Like

Comment Tag Exmaple:

This is a paragraph.

Types of Comments in HTML

There are three type of comment in HTML

  1. Single-line comments
  2. Multi-line comments
  3. <comment> tag

Single-line comments

In HTML Single-line and Multi-line comments are same thing, there is difference only in writing technics.

Example of Single-line

Result Look Like

GDATAMART.COM

Multi-line comments

This type of comments are used to comment multiple line together

Example of Multi-line

Result Look Like

Welcome To GDATAMART!!!

<comment> tag

Some browser like IE supports <comment> tag

Example of <comment> tag

Result Look Like

Comment Tag Example:

Comment Tag Browsers Support

All modern browser supports Single-line and Multi-line comments, so there is no need to use <comment> tag itself.

Element Chrome Edge Firefox Safari Opera
<!--> Yes Yes Yes Yes Yes

Event Attributes

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at "advertise@gdatamart.com"

© 2021 GDATAMART.COM (All Rights Reserved)