HTML <comment> and <!--....--> Tag

Advertisements


Description

The HTML <comment> tag allows authors to comment their HTML code. This tag is supported by IE only.

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

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>

This will produce following result:

This is a commented line in IE

Browser Support

Browser Support for <comment> tag

ChromeFirefoxIEOperaSafariAndroid
Not SupportedNot SupportedYesNot SupportedNot SupportedNot Supported

Browser Support for <!--...--> tag

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes

html_tags_reference.htm