• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Editing HTML > Inserting Comments

Inserting Comments

Comments are invisible notes you want to leave for yourself in the code—they won't show up in the browser window, but anyone can see these comments in the source code. You might want to add a reminder of when you created the file, when you last updated it, or who made the last revision.

You can also use comments to demarcate sections of a document, such as where a table begins and ends, or what part of the document constitutes the footer and copyright notice.

Comments look like this:

<!—- You can't see me -—>

To add a comment:

In either Code or Design View in the Document window, click to place the insertion point in the area where you want the comment to appear.

From the Document window menu bar, select Insert > Invisible Tags > Comment.


On the Objects panel (Invisibles category), click on the Comment button (Figure 4.49).

Figure 4.49. On the Invisibles category of the Objects panel, click on the Comment button.

The Insert Comment dialog box will appear (Figure 4.50).

Figure 4.50. Leave a message for yourself or for future producers of the page by using the Insert Comment dialog box. Dreamweaver enters the special opening and closing comment brackets for you.

Type the text you want to include in the comment in the Comment text box.

Click on OK to close the dialog box.

If you have invisible element viewing turned on (View > Invisible Elements), you'll see the comment icon.

Otherwise, you can look at the comment in the Code inspector (Figure 4.51).

Figure 4.51. The comment appears in the Code inspector, but not in the Document window.


You can view or edit the comments later on by selecting the Comment icon and viewing the Property inspector (Figure 4.52) or the Quick Tag editor (Figure 4.53).

Figure 4.52. You can view or edit your comment in the Property inspector by clicking on the Comment icon in the Document window.

Figure 4.53. You can view or edit your comment in the QT editor by clicking on the Comment icon and pressing Ctrl+T (Command+T).


To add comments to a file without storing them in the file itself and making them public, see Using Design Notes in Chapter 21. You can also add comments to non-HTML files this way.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint