A Powerful Example: Adding Alt Text Fast
You’ve just put the finishing touches on the last page of your brand-new, 1,000-page site. You sit back and smile—and then snap bolt upright when you notice you forgot to add an Alt description for the site’s banner graphic (see Adding an ID to an Image). This graphic, called site_banner.gif, appears on every single one of those 1,000 pages. With rising dread, you realize you have to open each page, select the graphic, and add the alt property by hand.
And then you remember Dreamweaver’s advanced tag-based Find and Replace feature.
Here’s what you do. Press Ctrl+F (⌘-F) to open the Find and Replace window. Set up the dialog box like this:
From the “Find in” menu, choose Entire Current Local Site.
You want to fix every page on your site (remember to make a backup first!).
From the Search pop-up menu, choose Specific Tag; from the pop-up menu to its right, choose “img.”
You’ll start by identifying every image (the <img> tag).
In the next row, use the three pop-up menus to choose With Attribute, “src,” and the equals sign (=).
This tells Dreamweaver to look for specific images—in this case, images with a src attribute (the path that tells a browser where on the web server to find the image file) with a specific value.
Type .*site_banner\.gif in the box next to the = sign.
For this exercise, assume you stored the graphics file in a folder called images located in the root folder of the site. The name site_banner.gif is the name of the image file. The .* ...
Get Dreamweaver CS6: The Missing Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.