Web Page CentralPoliciesHTMLFAQPublishingBookletToolsLinks

Home :: Learning HTML :: Comments

Search

[Help]
Match:

[Off Site Link]=Off Site Link[Help]

[Direct Link to File]=Link to File[Help]

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.

Basic Comment Explanation

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.

Slightly More Technical Comment Explanation

(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

Last Update: 2000-04-19
This Page's Address: http://www.madison.k12.wi.us/webpub/basics80.htm
District Home Page: http://www.madison.k12.wi.us
HTML Editor & Publisher: Chris Burch, cburch@madison.k12.wi.us
webmaster@madison.k12.wi.us