Editing HTML in Dreamweaver > Cleaning up HTML source code

 

Cleaning up HTML source code

Use the Clean Up HTML command to remove empty tags, combine nested font tags, and otherwise improve messy or unreadable HTML code.

To clean up HTML source code:

1 Open an existing document and choose Commands > Clean Up HTML.
2 In the dialog box that appears, select from the following options:
Remove Empty Tags removes any tags that have no content between them. For example, <b></b> and <font color="FF0000"></font> are considered empty tags, but the <b> tag in <b>some text</b> is not.
Remove Redundant Nested Tags removes all redundant instances of a tag. For example, in the code <b>This is what I <b>really</b> wanted to say</b>, the b tags surrounding the word "really" are redundant and would be removed.
Remove Non-Dreamweaver HTML Comments removes all comments that were not inserted by Dreamweaver. For example, <!--begin body text--> would be removed, but <!-- #BeginEditable "doctitle" --> would not (because it is a Dreamweaver comment that marks the beginning of an editable region in a template).
Remove Dreamweaver HTML Comments removes all comments that were inserted by Dreamweaver. For example, <!-- #BeginEditable "doctitle" --> would be removed, but <!--begin body text--> would not (because it is not a Dreamweaver comment). Removing Dreamweaver comments turns template-based documents into ordinary HTML documents and library items into normal HTML code (that is, they cannot be updated whenever the original template or library item changes).
Remove Specific Tag(s) removes the tags specified in the adjacent text field. Use this option to remove custom tags inserted by other visual editors and other tags that you do not want to appear on your site (for example, blink). Separate multiple tags with commas (for example, font, blink).
Combine Nested <font> Tags When Possible consolidates two or more font tags when they control the same range of text. For example, <font size="7"><font color="#FF0000">big red</font></font> would be changed to <font font="7" font="#FF0000">big red</font>.
Show Log on Completion displays an alert box with details about the changes made to the document as soon as the cleanup is finished.
3 Click OK.
Depending on the size of your document and the number of options selected, it may take several seconds to complete the cleanup.