[thelist] Tweaking Dreamweaver code (was Homesite vs Dreamweaver)

Charles Roper reachme at charlesroper.co.uk
Thu Mar 8 10:01:04 CST 2001


David,

> The other frequent one is removing the space
> from a spacer gif's "alt" attribute. Since DW doesn't insert an
> empty "alt"
> by default (alt=""), it's necessary to at least type in a [space]
> character,
> then go back in and delete those spaces.

There's a better way to do this using DW's Find and Replace function.

- Go to Edit > Find and Replace
- In the "Search For:" dropdown, select "Specific Tag" then type in or
choose the IMG tag from the dropdown next to it.
- Under that select "Without Attribute" and "alt"
- Select "Set Attribute" and "alt" for the "Action:" and leave the "To:" box
blank.

Now if you click Find All it will find all the img tags without an alt
attribute. You can now add alt="" to them selectively (by clicking on each
occurrence at the bottom of the dialog and clicking replace) or en masse
(replace all). You can even do this across an entire site by using the "Find
In: [Entire Site]" option.

If you've already added loads of alt=" " attributes (with the space)
manually you can do a simple search and replace using "Search For: [Source
Code]".

The Find and Replace function in DW is really very powerful, but is
tragically underused by most people.

HTH.

-Charles






More information about the thelist mailing list