HTML Comment

HTML Comment

HTML Comment Tag

Tags Description
<!– –> This tag is used to comment HTML elements.
Syntax
				
					<!-- Enter your comment here -->
				
			

Note: Commented elements are not displayed in the browser. However, comments allow you to add additional information to the source code, which can help you read or understand your HTML source code document later.

Examples
				
					<!DOCTYPE html>
<html>
<head>
<title>HTML Comment</title>
</head>
<body>
<!--The paragraph below is about Bangladesh-->
<p>Bangladesh is an independent country.</p>
</body>
</html>
				
			
Output
HTML Comment

Bangladesh is an independent country.

Conditional comments

You can also use conditional comments within HTML:

				
					<!--[if IE 8]>
HTML tags
<![endif]-->
				
			

You can specify tags in comments as an alternative to tags that are not supported in the Internet Explorer browser. This will ensure that the tags in the comments are displayed correctly when these codes are run in the Internet Explorer browser.

Chapter summary

  1. <!-- -->Used to comment HTML elements.

  2. Comments are used to set elements for Internet Explorer.

HTML Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *