- Adding Text
- Cutting, Copying, and Pasting Text
- Dragging and Dropping Text
- Using Paste Special
- Applying Headings
- Applying Character Formats
- Applying HTML Text Styles
- Using Preformatted Text
- Adding Line Breaks
- Indenting and Aligning Text with HTML
- Working with Lists
- Inserting Special Characters
- Working with Font Styles
- Using Web Fonts
- Adding Automatic Dates
- Finding and Replacing
- Finding Text with a Simple Search
- Performing Advanced Text Searches
- Finding and Replacing in Source Code
- Finding and Replacing with a Specific Tag
- Using Regular Expressions for Searching
- Checking Spelling
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
Choose Edit > Find and Replace, or press Ctrl-F (Cmd-F).
The Find and Replace dialog appears.
- From the Find in pop-up menu, choose one of the options for the scope of your search.
From the Search pop-up menu, choose Specific Tag.
The Find and Replace dialog changes to show the tag functions .
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.
(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.
- Choose from the Action pop-up menu, and depending on the action you chose, set any required values.
- Depending on what you want to do, click Find Next, Find All, Replace, or Replace All.