Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»html»HTML Comments
    html

    HTML Comments

    Editorial StaffBy Editorial StaffUpdated:April 23, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    HTML Comment Tag

    Comments in HTML have the same role as in any programming language.
    They can help to describe a section of the code, to explain what that section does.

    HTML Comments Syntax

     <!-- HTML comments here -->
    

    Example

      <!DOCTYPE html> 
      <html> 
      <body>
    
    <!-- Start paragraph here -->
    This is my first paragraph.
    
    This is my second paragraph.
    <!-- End paragraph here -->
    
    <a href="https://www.oixiesoft.com/">Visit Oixiesoft.com!</a>
      </body> 
      </html>
    

    Output


    This is my first paragraph.
    This is my second paragraph.

    Visit Oixiesoft.com!

    Hide Content

    Sometimes Html comments can be used to hide an entire piece of code.

    For example, we have a section of code that no longer uses us, but we don’t want to delete it either. So we can hide this section with the help of comments.

    Never comment on passwords or other confidential information in HTML or CSS. Even if the comments are not displayed in the browser, they appear in the source of the page loaded in the browser.

    Example1

      <!DOCTYPE html> 
      <html> 
      <body>
    <p>This is my first paragraph.</p> 
    <!--
    <p>This is my second paragraph.</p>
     -->
    
    <a href="https://www.oixiesoft.com/">Visit Oixiesoft.com!</a>
      </body> 
      </html>
    

    Output

    This is my first paragraph.


    Visit Oixiesoft.com!

    Example 2

      <!DOCTYPE html> 
      <html> 
      <body>
     
    This is my first paragraph.
    This is my second paragraph.
    
    <!--
     <img src="https://www.oixiesoft.com/wp-content/uploads/2022/04/Porcelain-Espresso-Cups-.jpg" />
    
     -->
      </body> 
      </html>
    

    Output

    This is my first paragraph.
    This is my second paragraph.
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    • HTML Introduction
    • HTML Editors
    • HTML Tags
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Comments
    • HTML Styles
    • HTML Text Formatting
    • HTML Colors
    • HTML links
    • HTML Images
    • HTML Styles – CSS
    • HTML Tables
    • HTML Lists
    • HTML Forms
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.