How to use Dreamweaver to organize HTML code and optimize webpage documents

Source: Internet
Author: User
Tags html comment website server

After the website is created, many beginners will immediately think about online publishing, hoping to immediately feel the fruits of their work. However, the results are often counterproductive, because there is still an important optimization test before the website is released. Website optimization refers to the optimization of the hwl source code of the website, and website testing refers to the effective testing of all webpages on the site, the purpose is to discover as many problems as possible in the shortest time, and then go through a process of discovering and solving the problems, this ensures that the webpage runs stably and normally after the test period as short as possible.


A website with good performance should be optimized in the later stages of its construction. Currently, there are many webpage editing tools besides Dreamweaver, such as FrontPage or Word 2003. Web pages created by these tools may produce invalid spam code. This greatly increases the size of webpage documents, thus increasing the burden on the website server, so that our users can download longer times when accessing the website, and the Web browsing speed slows down, unexpected errors may even occur.

Fortunately, the Dreamweaver tool improves the HTML source code optimization function, which can minimize the amount of junk code in the webpage documents, so as to fix code errors and improve the source code quality. Here we will introduce how to use Dreamweaver to optimize the website.

1. Organize HTML code

Dreamweaver provides a special pattern for the code of existing documents to retypeset for reading and understanding J

You don't have to worry about changing the substantive content of the Code.


The procedure is as follows:


① Open the webpage document to be optimized.

② In the document window, select "commands" (command set)> "Apply"
Source formatting (application source code formatting ).


By executing this menu operation, you can make the HTML source code format more appealing and easier to read.

2. Optimize webpage documentation


By using the clean up HTML (optimized html) Command provided by Dreamweaver, you can

Removes empty tag nested Font tags and so on, which can reduce the amount of Web Page code.


The procedure is as follows:


① Open the webpage document to be optimized.


② Select the "commands" menu in the document window, and then select the "clean up html" command.

③ Then, the system will pop out a dialog box reminding you to select the optimization method.


④ In the Remove Area, the system asks the user to specify the content to be deleted.

(A) Empty tags: If this check box is selected, the system automatically deletes the tag that does not contain any content in the document.

(B) Dreamweaver HTML comments (Dreamweaver HTML comment): If this check box is selected, the system will delete all comments generated by Dreamweaver from the document. Before uploading, delete all the annotations to increase the download speed. However, if you delete the Dreamweaver annotation, some functions of Dreamweaver will disappear, such as automatic template update, library entries, and page ing:

(C) Specific tag (option): If this check box is selected, the system can delete a specific tag from the document. With this feature, you can delete the tags, custom tags, or those that do not want to be forwarded to the site from other visual editors in the document.


⑤ In the option area, you can set other options during the optimization process.


● Combine nested <font> tags when possible (as much as possible to integrate nested <font> tags): select the check box and the system will re-combine the nested Font tags in the webpage document.


● Show Log On completion (prompt displayed after completion): select this check box and the system displays related prompt information after the optimization operation is complete.


6. After these settings are complete, click the 0k button to optimize the currently opened document.

This article was first published on a forum. Reprinted please keep the link!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.