Home Advertise with us Forum Articles Sitemap Contact
Logo  

HTML Comments

Specifying a statement as comment causes the web browser to ignore it while displaying the web page. Using the <comment> tag, comments are inserted in the source code. This means that the only possible way of viewing a comment is to look through the source code of the web page.

The biggest advantage of using comments in the source code is that, it can be used to explain or keep notes for your code so that you don’t forget anything the next time you have to edit the source code.

The comments are also a good place to store program specific information so that they are available to the programmer without being visible to the user. Using comments proves especially beneficial in case of old browsers that do not support styles or scripting. For such browsers, the text inside style & script elements can be specified as comment. One thing to note about comments is that it does not support any standard or event attribute.
The syntax for writing a comment goes as:

A less than sign (<) followed by an exclamation mark (!) and two dashes (--). This is followed by the comment, two dashes (--) and a greater than sign (>).

Example:

<script>

<!--  document.write ("Hi! It’s me!")  //-->

</script>
 

HTML Tip 1

Use only hexadecimal #RGB values for colors. The behavior of named colors is browser-idiosyncratic and totally unpredictable.
 
 

HTML Tip 2

You can resize your images without a graphics program by changing the HEIGHT and WIDTH in your image tag.