Monday, September 3, 2007

How can I include comments in HTML?

Technically, since HTML is an SGML application, HTML uses SGML comment syntax. However, the full syntax is complex, and browsers don't support it in its entirety anyway. Therefore, use the following simplified rule to create HTML comments that both have valid syntax and work in browsers:

An HTML comment begins with "", and does not contain "--" or ">" anywhere in the comment.
The following are examples of HTML comments:

*
*
*

Do not put comments inside tags (i.e., between "<" and ">") in HTML markup.

No comments: