Home :: Learning HTML :: Comments
Occasionally you will want to leave comments in your HTML so that you and others working with you know just what the heck you were doing when you did something.
A comment begins with <!-- and ends with -->. Example:
<!-- Beginning of Menu Section -->
Comments will not appear on your document, but they will appear in your source code.
Do not put other HTML tags into a comment: the > bracket may accidentally end the
comment prematurely in some browsers.
(Don't read if you don't care.) Actually, <! starts an
SGML Declaration, and > ends it. So when you make a comment, you're not really
making an HTML comment, you're making an SGML comment without even knowing it.
Another SGML Declaration you should be familiar with is the DOCTYPE Declaration at
the beginning of all your HTML pages: <!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 3.2//EN">. See, there's no dashes in it because it's not a comment.
But because it starts with <!, it's not HTML, either. That's why it comes before
the <HTML> tag. Just in case you were wondering.
Previous: Nesting Elements
Next: Tables
Home:: Learning HTML :: Comments
Home |
Policies |
HTML |
FAQ
Publishing |
Booklet |
Tools |
Links