Previous Section  < Day Day Up >  Next Section

17.1 Snippets Basics

Snippets aren't fancy or complex, but they sure save time. A snippet is simply a chunk of code that you store away and then plunk into other Web pages. It could be HTML, JavaScript, or any of the other programming languages you might encounter. Dreamweaver comes with hundreds of snippets organized into different folders, like Comments (for adding HTML, CSS, and JavaScript comments) Footers (canned footer designs), and Form Elements (useful form parts like pull-down menus).

For example, say you always use the same table design to create a sidebar on a page. Each time you want to create a similar table, you could go through all the same steps to build it梠r you could turn that table into a snippet, and then, with a simple double-click, add it to page after page of your site.

You keep these code chunks in the Snippets tab of the Code panel (see Figure 17-1). You access them in any of several ways:

  • Choose WindowSnippets.

  • Press Shift-F9.

  • Click the Snippets tab on the Code panel.

Above and beyond Dreamweaver's preinstalled snippets, you can quickly build a collection of your own.

    Previous Section  < Day Day Up >  Next Section