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.
That’s awesome Bro, will this work as a comment box ?
Much appreciated.
Watkinsservices@live.com
Thanks again,
-Joe
*le facepalm
No. It won’t work as a comment box. It allows you to put stuff in your code that won’t show up on the page.
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
Seein how this works
gud
thanks it’s nice
Cool trick, I will def give it a try, thank you for sharing.
thank u.
html comments are particularly useful if you edit a page and you want to find your changes fast. The more detailed these comments are, the better…
Stamatis – Ygraeriokinisi
Too bad html editors like Notepad++ can’t handle easy comment-block adding like in the case of JS comments, when you can add them easily by selecting the code and using a shortcut key combination.
Hi, is there a way I can create a shortcut for this html comment using a MacBook Pro OS Snow Leopard.
Have you ever considered marking blocks like so:
I do that, but I like to use server side languages instead so it doesn’t need to come over the pipes.
</div><?php // END div#comments ?>
awesome Stuff bro keep it up my website superblogger
Putting comments in your files is a very good idea. I also use them all the time in my html and even more so in my CSS files for the Joomla sites I develop. All those elements get mixed up in your mind after awhile and when you are adding code or altering pre existing stuff it’s helpful to comment on it so you remember what everything is or what you did to it. Sometimes I make changes then have to go back and tweak them. A comment helps me remember what I did and is a big time saver.
Nice thing is you can use it like block comment also:
awesome…comment preview is odd.
I’ve never seen people get so excited about comments. geez.