< All the HTML Tags >

<!−− −−>!

Video Coming Soon...

  • comment

    Tag Type

    metadata

    Tag Category

    metadata

    Allows developers to insert notes or explanations directly within the source code

    Viewed

    1

    Examples

    3

Definition:

The HTML comment tag allows developers to insert notes or explanations directly within the source code without affecting the web page’s visual content, as comments are not displayed by browsers. This tag is essential for code organization, collaboration, and leaving instructions or reminders for future edits.

Attributes:

HTML comments do not have any attributes.

Accessibility:

Invisible to Users: HTML comments are only visible in the source code. They do not affect how the page is displayed, nor are they announced by screen readers.


Assistive Technologies: Screen readers and other assistive tools ignore HTML comments, meaning they do not read or interact with them. Since comments don't impact the user experience, they don't need special handling for accessibility.

Default <!−− −−>! Example:

The HTML comment tag allows developers to insert notes or explanations directly within the source code on a single line
<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
  </head>
  <body>
    <!-- I am a single line comment -->
  </body>
</html>

Default <!−− −−>! Example:

The HTML comment tag allows multi-line comments
<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
  </head>
  <body>
    <!-- 
    I am a 
    multi line 
    comment 
    -->
  </body>
</html>

Default <!−− −−>! Example:

The HTML comment tag temporarily hides some code from the user
<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
  </head>
  <body>
    <!-- 
    I am temporarily hiding some code:
    <p>This paragraph is hidden from the user but still visable in code </p>
    -->
  </body>
</html>

Default <!−− −−>! Result:


Title No Content Output

Community Examples:

Coming Soon…
Coming Soon…