HTML - <!--Comments--!>
Comments are often used in the HTML codes. That is why it is important not to be pointed out to the browser to avoid showing them.
There are many reasons we can add a comment within a html script.
- A note or a reminder, a specification or a clarification.
- Javascript comments
- An unfinished element
The comment will be placed between the "<!--" and "-->" tags. This way, we will be able to leave a note to remember on a later time what the code was for, or if something is still needed to be introduced in there.
<!--The beginning of the code that shows a photo--> <img src="../img/banner.gif" width="150" height="50" /> <!--The end of the code that shows a photo--> |
Display
This is just an example of the things you can comment in a script. In time, you
will learn that these comments are very useful for a better understanding of the
code at a later date.
Any text, or characters, symbols or anything else placed between the opening
tag "<!--" and the ending tag "-->" will not be shown by the browser.
HTML - Unfinished script
Comments are very useful when you work at a script but you leave it unfinished.
Putting it between the two tags (<!-- code -->) will be interpreted as a comment
by the browser and therefore will not be shown.
<!-- <input type="text" size="12" /> -- Input Field --> |
When you have finished the code and you will need to show it all you will need to do is to erase the two tags and the browser will show the wanted script.
<input type="text" size="12" /> |
Display
|
HTML - Javascript comments
Comments are also used in javascript. We will talk about this in another tutorial though, dedicated to that subject. These comments will have a different goal than the informative one though.
<?php include("../../en/pannels/468x60ad.php"); ?>
