HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

HTML Comments

In HTML, you can use comments to include explanatory notes or annotations within your code. Comments are not displayed in the browser when the page is rendered and are intended for developers or anyone reviewing the code.

There are two types of comments in HTML:

Single-line Comments:

  • Single-line comments are created using the <!-- --> syntax.

Example

<!-- This is a single-line comment --;

<p>This is my webpage.</p>
<!-- Comments are not displayed in the browser -->
You can click on above box to edit the code and run again.

Output

This is my webpage

multi-line Comments:

  • Multi-line comments can span multiple lines and are also enclosed in <!--and -->

Example


    

This is a CodeLines Tutorial.</p> <!-- <p>Look at this site:</p> <p> --> <p>This is a paragraph.</p>

You can click on above box to edit the code and run again.

Output

This is a paragraph.