Dreamweaver How to clean up cumbersome and redundant web page code

Source: Internet
Author: User
Tags dreamweaver

We sometimes use Word directly to make Web pages for convenience, because we are more familiar with Word, more convenient for typesetting, or we just want to take advantage of the pictures and text in Word. But the pages generated directly by using Word can have a lot of redundant code. We all know that programmers should try to implement complex functions with simple code, and then we'll see how DW can help us clean up the tedious web page code.

Steps/Methods

1, first of all, we open a Word document, convert it to the HTM Web page file.

2, click Start, and then choose Save As. You can see the Save As dialog box. Select the save type as a single file Web page.

3, then we can see that generated a Web page file.

4, open your DW, and then click Open.

5, we came to the Open dialog box, we select just generated page file

6, this is the open Web page file.

7, we click on the code to bring the file code format interface.

8, we come to the end of the code, look at this file has 2411 lines of code. Once we've cleaned up the redundant code, we'll see how many lines there are.

9. Select commands to clean up word-generated HTML.

10, select Word 2000 and later. Tick all the code. The option here is not to delete the code, but to organize the code, the final cleanup effect is the same as the original file. So, you can safely check all the options.

11, click OK, we see this feedback dialog box, tell us how much has been deleted.

12, then click OK, let's take a look at how many lines of code. It was just 2411 lines and now it's 1147 lines.

13, we click on the Design button to see if the effect has changed. Well, the effect is the same as not being sorted out at first. Through our collation, your website download speed will be greatly improved.

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.