CommentsComments are used in HTML to allow you to place content in the code that won't appear to the user via the browser. (It will be readable when the user "views source," however.) If you've ever programmed in BASIC, think of REMarking out code -- when we comment out HTML, it's the same thing. There are several reasons you might do this. Sometimes you want to temporarily prevent some code from displaying, but you know you'll want to put it back later. So you might comment it out, and then uncomment it later. Another reason to comment is to provide notes to yourself or any other people who may work on your website. You could put in a comment that says "Don't delete this paragraph, no matter what", or a comment that says "Place banner ad here when available." A typical comment looks like this:
The <!-- marks the beginning of the comment and the --> marks the end. Everything between those two marks will not display on the web page at all, unless the user views source. In the next section, we'll finally learn how to link to other sites. |