Thursday, February 10, 2011

Comments in HTML Code

If you are are writing HTML code for a website, it helps if you leave yourself some comments in html and notes to help keep all that data straight. Luckily there is an option that you can put a comment area within the code itself. The comment can not be seen by any user viewing the site, but in actual it is saved along with the rest of the site so it is available any time you need it.


Choose the area in the code you want your comment area to be. It can be placed anywhere within the document, as long as it is not within another HTML tag.

Write your comment. An example may be:
File Created on 12/02/2011
File updated on 13/02/2011

Add the following comment html code
<!-- File Created on 12/02/2011 -->
<!-- File updated on 13/02/2011-->

Save the file as html and view it in a web browser. Your comment is invisible, but still in the HTML code.

No comments:

Post a Comment