HTML 5 Comments


This element is used to add a comment to an HTML document. An HTML comment begins with <!–– and the comment closes with –– >. HTML comments are visible to anyone that views the page source code but are not rendered when the HTML document is rendered by a browser.

What are HTML Comments?

Advertisements. Comment is a piece of code which is ignored by any web browser. It is a good practice to add comments into your HTML code, especially in complex documents, to indicate sections of a document, and any other notes to anyone looking at the code.

<!-- comments in html -->
 < p> this is comment use  example  < /p>

<!-- this is p tag -->


Comments Don’t show on result page or in a web browser.


 <title> LearnPHPonline</title>
 <p> paragraph </p>  <!-- this is paragraph -->


What is the use of comment tag?

The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers. You can use comments to explain your code, which can help you when you edit the source code at a later date. This is especially useful if you have a lot of code.

 95 total views,  2 views today