fbe University of New South Wales Sydney Australia UNSW
Faculty of the Built Environment search
HTML Reference
Comments

It's often very useful to include comments, inside your HTML files! Either to "comment-out" some of the HTML or simply to add "notes".

The comment tag is a unary tag in that the comment is placed inside the tag. The beginning of the tag is "<!--" and the end of the tag is "-->". Any tags placed within the comment are ignored.

If you do a View - Source on a HTML file you’ll often find comments written by the Author, either about the file or about themselves.

Syntax:

<!-- text -->

Note that some (older) browsers terminate comments at the first ">" character encountered after the initial "<!--". This is incorrect.


Go to next section: Horizontal Lines or return to the Contents page.

Last Updated: 06 November 1998