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

Home > Articles > Web Design & Development > Adobe Dreamweaver

  • Print
  • + Share This
  • 💬 Discuss

Finding and Replacing with a Specific Tag

A specific tag search lets you find and modify HTML tags. This has many uses; for example, you may still need to convert old sites that used <font> tags to CSS. You can use a specific tag search to strip out all those old tags, replacing them with CSS classes. 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.5 for a list of the actions available.

Table 4.5. 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 & Contents

Deletes the tag and all of its contents.

Strip Tag

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

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 specified tag.

Add After Start Tag

Inserts text or HTML after the specified tag.

And After End Tag

Inserts text or HTML after the closing 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 red-a.jpg.

    04fig45.jpg

    click here to view image

    red-a.jpg 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. Depending on the tag you choose, Dreamweaver will change the available actions in the Action pop-up menu, so don’t be surprised if the contents of that menu look a bit different from those listed in Table 4.5.

  5. (Optional) If you want to narrow the search to a particular attribute of the tag that you selected, click the + button and 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, and 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

Discussions

comments powered by Disqus