Computer >> Computer tutorials >  >> Programming >> HTML

How do we add a comment in HTML code?


The HTML <comment> tag allows authors to comment their HTML code.

It is recommended to use <!--....--> to comment your tags. This tag is compatible with all browsers.

Note − The <comment> tag deprecated in HTML5. Do not use it.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>HTML <!--....--> Tag</title>
   </head>
   <body>
      <comment>This is a commented line in IE</comment>
      <!-- This is a commented line supported by almost every browser.
         It will not appear in output as its a comment.
      -->
   </body>
</html>