HTML Comments
- Previous Page HTML Quotations
- Next Page HTML Colors
Comment tags <!-- and --> are used to insert comments in HTML.
HTML Comment Tags
You can add comments to the HTML source code using the following syntax:
Example
/* Write comments here */
Comments:There is an exclamation mark in the start tag, but not in the end tag.
Browsers do not display comments, but they can help record your HTML document.
You can use comments to place notifications and reminders in HTML:
Example
/* This is a comment */ <p>This is a paragraph.</p> /* Remember to add information here */
Comments are also very helpful for HTML error correction, because you can comment on one line of HTML code at a time to search for errors:
Example
/* This image is not displayed at this moment: <img border="0" src="/i/tulip_ballade.jpg" alt="Tulip"> -->
Conditional Comments
You may occasionally find conditional comments in HTML:
<![if IE 8]> .... some HTML here .... <![endif]-->
Conditional Comments define HTML tags that are only executed by Internet Explorer.
Software Program Tags
Various HTML software programs can also generate HTML comments.
For example, the <!--webbot bot--> tag is enclosed in HTML comments created by FrontPage and Expression Web.
As a rule, the existence of these tags helps support the software that creates them.
- Previous Page HTML Quotations
- Next Page HTML Colors