A Web Design Community curated by Chris Coyier

Code Snippets Gallery

Code Snippets > HTML > Comments in HTML Submit one!

Comments in HTML

<div id="header">
   <p>Stuff</p>
</div> <!-- END div-header -->

The <!– –> stuff is the HTML comment. It is a way to add notes into the code which will not display when the HTML is rendered by the browser. In the example above, to signify which opening div tag the closing tag was actually closing.

4 Responses

  1. That’s awesome Bro, will this work as a comment box ?
    Much appreciated.

    Watkinsservices@live.com

    Thanks again,
    -Joe

  2. Grant says:

    Hey @Joshephy Watkins

    If you are talking about a comment box like what I typed this message in, it won’t. It will just put a note in the HTML code for you to use later (I usually go stuf…… To keep everything organized

Leave a Comment

Remember:
  • Be nice.
  • Wrap multiline code in <pre> and <code> tags and escape it first (turn <'s into &lt;'s).
  • You may use regular HTML stuff like <a href="">, <em>, and <strong>
* This website may or may not contain any actual CSS or Tricks.