You can add comments to your (X)HTML documents in order to remind yourself (or future editors) what you were trying to achieve with your (X)HTML tags. These comments only appear when the document is opened with a text editor. They are invisible to visitors in the browser.
To add comments to your HTML page
- In your (X)HTML document, where you wish to insert comments, type <!--.
- Type the comments.
- Type --> to complete the commented text.
Example 3.21. Comments are a great way to add reminders to your text. You can also use them to keep track of revisions.
<body> <!--Here is the table of contents, which in a real document might be a good deal longer.--> <div id="toc">Antoni Gaudí<br />La Casa Milà<br />La Sagrada Família</div> <div id="gaudi"> <h1>Antoni Gaudí</h1> <p>Many tourists are drawn to Barcelona to see Antoni Gaudí's incredible architecture. </p> <p>Barcelona celebrates the 150th anniversary of Gaudí's birth in 2002.</p> <div class="works"> <h2>La Casa Milà</h2> <p>Gaudí's work was essentially useful. La Casa Milà is an apartment building and <span class="emph">real people</span> live there.</p> </div> <div class="works"> <h2>La Sagrada Família</h2> <p>The complicatedly named and curiously unfinished Expiatory Temple of the Sacred Family is the <span class="emph">most visited</span> building in Barcelona. </p> </div> </div> </body></html>
Figure 3.22 Comments are invisible (though they readily appear when the source code is displayed—see page 57).