How is the use of comments and how do you write comments in HTML ?

How is the use of comments and how do you write comments in HTML ?

Table of contents

  1. Comments are some text or code written in your code to explain the code, and not visible to the user.

  2. Comments which are used for HTML files are known as HTML comments.

  3. Anything written between these tags will be ignored by the browser, so comments will not be visible on the webpage.

  4. Comments of any code make code easy to understand and increase the readability of code

  5. Comments are also part of the code, which explains the code.

Adding comments to HTML


-> You can add comments in a HTML file using <!....> tag. So if you will write anything between these comment tags that will be treated as a comment and the browser will not read it.