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

Home > Articles > Web Design & Development > Adobe Dreamweaver

  • Print
  • + Share This
This chapter is from the book

Finding and Replacing with a Specific Tag

A specific tag search lets you find and modify HTML tags. This has many uses; for example, many people are now converting old sites that used <font> tags to CSS. You can use a specific tag search to strip out all those old tags. Or you can change the now-passé <b> and <i> tags to their more modern equivalents, <strong> and <em>.

The key to the specific tag search is the Action menu, which specifies what replacement action Dreamweaver will carry out on the tags found in the search. See Table 4.4 for a list of the actions available.

Table 4.4. Action Menu Options

Action

Description

Replace Tag & Contents

Replaces the tag and everything within the tag with the contents of the field that appears to the right of the Action pop-up menu when this action is selected. This can be either plain text or HTML.

Replace Contents Only

Replaces the contents of the tag with the contents of the With field.

Remove Tag & Comments

Deletes the tag and all of its contents.

Strip Tag

Removes the tag, but leaves any content within the tag.

Change Tag

Substitutes one tag for another.

Set Attribute

Changes an existing attribute to a new value, or adds a new attribute.

Remove Attribute

Removes an attribute from a tag.

Add Before Start Tag

Inserts text or HTML before the opening tag.

Add After End Tag

Inserts text or HTML after the closing tag.

Add After Start Tag

Inserts text or HTML after the opening tag.

Add Before End Tag

Inserts text or HTML before the closing tag.

To find and replace within a specific tag:

  1. Choose Edit > Find and Replace, or press Ctrl-F (Cmd-F).

    The Find and Replace dialog appears.

  2. From the Find in pop-up menu, choose one of the options for the scope of your search.
  3. From the Search pop-up menu, choose Specific Tag.

    The Find and Replace dialog changes to show the tag functions (Figure 4.44).

    Figure 4.44

    Figure 4.44 When you are searching within a specific tag, you can add attributes for that tag, and you can also specify actions that you want to perform on the found tag.

  4. Choose the tag that you want from the tag pop-up menu that appears next to the Search pop-up menu.

    You can either scroll the pop-up menu to find a tag, or you can type the first letter of the tag in the box. Dreamweaver automatically scrolls the list.

  5. (Optional) If you want to narrow the search to a particular attribute of the tag that you selected, click the + button, then choose values for that attribute, as discussed previously in this chapter.

    If you want to narrow the search further, you can do so by clicking the + button and adding attributes.

  6. Choose from the Action pop-up menu, then (depending on the action you chose) set any required values.
  7. Depending on what you want to do, click Find Next, Find All, Replace, or Replace All.
  • + Share This
  • 🔖 Save To Your Account