// Tutorial //

How To Create HTML Comments

Published on June 21, 2016 · Updated on October 12, 2020
    Default avatar
    By Alligator.io
    Developer and author at DigitalOcean.
    How To Create HTML Comments

    Introduction

    This article will show you how to add comments to HTML.

    Prerequisites

    Adding Comments in HTML

    This is how you create a comment in HTML:

    <!-- I'm a comment! -->
    

    In this second example, we’re using an HTML comment to comment out some markup:

    <!-- Look, a shark!
      <p>Sammy</p>
    -->
    

    Conclusion

    Creating comments is an important element to writing HTML.

    For a more comprehensive review of the HTML5 markup language, explore our series, How To Build a Website in HTML.


    Want to learn more? Join the DigitalOcean Community!

    Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

    Sign up
    About the authors
    Default avatar
    Developer and author at DigitalOcean.

    Default avatar
    Developer and author at DigitalOcean.

    Still looking for an answer?

    Was this helpful?
    Leave a comment