You can pepper your pages with explanatory text and reminders to yourself (or to other members of your Web-building team) in the form of HTML comments. Comments are notes that appear only inside the page's code, but not to visitors viewing the finished page with a Web browser. To insert a comment, follow these steps:
With the Web page open, click in Code view wherever you want to insert the comment.
Make sure that your insertion location isn't inside an HTML tag.
On the Code View toolbar (choose View Toolbars Code View), click the Insert Comment button.
Or, choose Edit Code View Insert Comment.
The opening and closing tags for comments appear in the code, like this:
<!-- -->
Type your comment between the opening and closing comment tags.
A comment looks like this in the code:
<!-- this is a comment -->
To edit a comment, select the comment text (without selecting the opening and closing tags) and type the new comment text.
To delete a comment, follow these steps:
In Code view, click anywhere inside the comment.
On the Code View toolbar, click the Select Tag button.
The comment and its opening and closing tags are selected, indicated by gray shading.
Press the Delete key.
REMEMBER | Comments aren't completely invisible; your visitors can see the comments if they look at your page's underlying HTML tags. If you want to keep your comments completely private, you can tell Expression Web to strip out the comments before you publish your site. We explain how in Chapter 12. |
You can also add comments to your CSS style sheets, but the syntax is a bit different from that of regular HTML comments. We show you how to create CSS comments in Chapter 9.