For Dreamweaver This vast number of users have heard of web editing tools, in addition to powerful, Dreamweaver has been praised for similar web page editing software to produce the least garbage code, keep the original page code the best Web editor. This is confirmed in our use, and it is the most outstanding in the WYSIWYG Web editing software. Let's talk about using Dreamweaver to prevent and eliminate the generation of spam code.
First, prevent the production of garbage code
Dreamweaver generally does not make the Web page arbitrarily add unnecessary HTML code, but when editing a Web page Some irregular operation will also make some unnecessary code legacy, so in the editing process should try to avoid or reduce the following operations:
1. Avoid overly complex web page architectures. When planning a Web page, we use the table, we should try to find the simplest form format, do not make the table very complicated. It is also possible to reduce the nesting of tables within the table, rather than nesting them too much.
2. Moving pictures, text, or other objects too frequently on a Web page can create unnecessary code, so you should reduce the movement of pictures, text, or other objects frequently.
3. Be sure to avoid text interleaved styles. The text interleaved style used here refers to the following: if there is a text for "editing the Web page, some of the informal", we have to "edit the page" using a style, and later modified, to the "edit the page when some of the informal" text use style, If you add a style to this text without canceling the style you used, it will repeat the code several times with the same definition style, as long as you click the style. So be sure to avoid this.
4. Avoid duplication of object formatting definitions. That is, avoid the useless operation of defining the same format for an object that inherits the superior object format.
5. The multiple modifications we make to the definition of the same object's format or style also produce unnecessary code. So when you modify the format or style of an object, you should first remove the formatting that it originally defined, and then define it. For example, when we add a bold and a style to a text, then ramp it up and then use another style, it leaves the unused style code for the first application. And this unnecessary code is unable to eliminate unnecessary code in the end of the method to eliminate, you can only manually eliminate the page source code.
Second, the elimination of the generated garbage code
Although in the editor we try hard to prevent unnecessary code generation, but there will be prevent the occurrence of the situation. These unnecessary code will affect the download speed of the Web page and the compatibility of the Web page, so after editing the page, you must manually clear them. In Dreamweaver, click to select Menu Commands/clean Html ... Open/clean up HTML window, in the window remove item has five options to clear unwanted code: Empty tags (empty tags); redundant Nested tags (extra nested tags); Non-dreamweaver HTML Comments (comments in Dreamweaver format); Dreamweaver HTML Comments (Dreamweaver note); specific tag (s) (specified label), generally we select the first four options, and then click OK. We can also select the Fifth option specific Tag (s) to specify the spam code we want to clear.
For converting Word formats to HTML files, you can click the menu Commands/clean up Word html ... Open the Clean Up Word HTML window to clear more than the tags in the transformation.