Using code hints

Using code hints

The code hints feature helps you insert and edit code quickly and without mistakes. When you type certain characters in Code view, such as the first letters of a tag or attribute or CSS property name, a list appears, suggesting options to complete your entry. You can use this feature to insert or edit code, or just to see the available attributes for a tag, the available parameters for a function, or the available methods for an object.

Code hints are available for a variety of kinds of code. An appropriate list of items appears when you type a particular character that indicates the beginning of a piece of code; for example, to display a code hints list of HTML tag names, type a start bracket (<).

The code hints list disappears when you press Backspace (Windows) or Delete (Macintosh).

To display a code hints menu if it doesn’t appear automatically:

  • Press Control+Spacebar (Windows) or Command+Spacebar (Macintosh).

To insert markup or other code in Code view using code hints:

  1. Type the beginning of a piece of code. For example, to insert a tag, type a start bracket (<); to insert an attribute, place the insertion point immediately after a tag name and press Spacebar.

    A list of items (such as tag names or attribute names) appears.

  2. Scroll through the list using the scroll bar or the Up Arrow and Down Arrow keys.
  3. To insert an item from the list, double-click it, or select it and press Enter (Windows) or Return (Macintosh).

To insert a closing tag:

  • Type </ (slash).

    By default, Dreamweaver determines what tag needs to be closed and closes it for you. You can change this default behavior so that Dreamweaver inserts a closing tag after you type the final angle bracket (>) of the opening tag, or so that it inserts no closing tag at all. Select Edit > Preferences > Code Hints, and then select one of the Close Tags options.

To edit a tag using code hints, do either of the following:

  • To replace an attribute with a different attribute, first delete the attribute and its value, then add a new attribute and its value as described in the previous procedure.
  • To change a value, first delete the value, then add a new value as described in the previous procedure.

Related topics

  • Setting code hints preferences

Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Setting Up Your Coding Environment
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly