Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Comments

HTML Comments

HTML comments are useful in the documentation purposes of the HTML code such as about the working of code, what it does, etc.

The browser ignores the comments and does not display them. It is only for the developers to use for a better understanding of the HTML code.

Comment Tag

To add comment in the HTML document, use the following syntax

					 
        
          <!-- Your comment goes here -->
        
      
Inline Comments

To add more information about the code such as modifications in the future, notifications, alerts, reminders, etc. in a single line.

Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <body>
              <!-- Below code display a simple paragraph -->
              <p>This is simple paragraph</p>
              <!-- Some interesting content come in the future -->
            </body>
          </html>
        
      
Block Comments
Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <body>
              <!--
                This is a
                multi line
                comment.
              -->
              <p>This is simple paragraph</p>
            </body>
          </html>
        
      
Hide Content

Sometimes we need to hide some content for testing or any other purpose. HTML comments come in handy for this.

Let's see with some example
					 
        
          <!DOCTYPE html>
          <html>
            <body>
              <p>This paragraph display</p>

              <p>This is <!-- simple --> paragraph</p>

              <p>This paragraph display too</p>

              <!--
                <p>This is not display</p>
                <a href="https://lynxsia.com/" >Same for this link</a>
              -->
            </body>
          </html>
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved