Using Comments in HTML


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:

  1. 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.

  2. image from book On the Code View toolbar (choose View image from book Toolbars image from book Code View), click the Insert Comment button.

    Or, choose Edit image from book Code View image from book Insert Comment.

    The opening and closing tags for comments appear in the code, like this:

     <!-- --> 
  3. 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:

  1. In Code view, click anywhere inside the comment.

  2. On the Code View toolbar, click the Select Tag button.

    image from book The comment and its opening and closing tags are selected, indicated by gray shading.

  3. 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.



Microsoft Expression Web for Dummies
Microsoft Expression Web For Dummies
ISBN: 0470115092
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net