- Adding Text
- Cutting, Copying, and Pasting Text
- Dragging and Dropping Text
- Using Paste Special
- Applying Headings
- Applying Character Formats
- Changing Fonts and Font Sizes
- Making Your Own Font Lists
- Changing Font Color
- Applying Text Styles
- Using Preformatted Text
- Adding Line Breaks
- Indenting Text
- Aligning Text
- Working with Lists
- Setting List Properties
- Nesting Lists
- Inserting Special Characters
- Adding Automatic Dates
- Adding Horizontal Rules
- 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, 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:
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 (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.
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.
(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.
- Choose from the Action pop-up menu, then (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.