Publishers of technology books, eBooks, and videos for creative people

Home > Articles

This chapter is from the book

Commenting your code

Comments allow you to leave notes within the code—invisible in the browser—to describe the purpose of certain markup or provide important information to other coders. Although you can add comments manually at any time, Dreamweaver has a built-in feature that can speed up the process.

  1. Open myfirstpage.html using the Developer workspace.

  2. Insert the cursor after the opening tag <aside class="sidebar1">.

  3. Click the Apply Comment icon icon_comment.jpg.

    A pop-up menu appears with several comment options. Dreamweaver supports comment markup for various web-compatible languages, including HTML, CSS, JavaScript, and PHP.

  4. Choose Apply HTML Comment.

    An HTML comment block appears, with the text cursor positioned in the center.

  5. Type Insert customer testimonials into Sidebar 1

    The comment appears in gray between the <!-- and --> markup. The tool can also apply comment markup to existing text.

  6. Insert the cursor after the opening tag <aside class="sidebar2">.

  7. Type Sidebar 2 should be used for content related to the tour or product

  8. Select the text created in step 7.

    Click the Apply Comment icon icon_comment.jpg.

    A pop-up menu opens.

  9. Select Apply HTML Comment.

    Dreamweaver applies the <!-- and --> markup to the selection. If you need to remove existing comment markup from a selection, click the Remove Comment icon icon_comremove.jpg in the toolbar.

  10. Save all files.

You’ve created a basic webpage, complete with placeholder text. The next step is to style the page. Dreamweaver supports CSS preprocessors. In the next exercise, you’ll learn how to set up and create CSS styling using a preprocessor.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.