Home > Articles > Web Development > HTML/CSS

  • Print
  • + Share This
This chapter is from the book


You can put comments into HTML pages to describe the page itself or to provide some kind of indication of the status of the page. Some source code control programs store the page status in comments, for example. Text in comments is ignored when the HTML file is parsed; comments never show up onscreen—that’s why they’re comments. Comments look like the following:

<!-- This is a comment -->

Here are some examples:

<!-- Rewrite this section with less humor -->
<!-- Neil helped with this section -->
<!-- Go Tigers! -->

As you can see from Figure 4.4, users can view your comments using the View Source functionality in their browsers, so don’t put anything in comments that you don’t want them to see.


FIGURE 4.4 HTML comments displayed within the source for a page.

  • + Share This
  • 🔖 Save To Your Account