SEO optimized code must read, teach you to the Web page perfect slimming!

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Each SEO should be proficient in web page code optimization, because the search engine and people are not the same, they are not eyes to see, but through the code to analyze the page. Especially on the large web site, site code optimization work to a large extent affect the work of SEO results. Today, SEO to share a few web code optimization experience to everyone.

1, clear code in the garbage code, such as: Meaningless spaces, default properties, comment statements and empty statements.

In particular, the creation of the Web page in the process of space, there will certainly be a lot, the general 100K size of the page, the space occupied by about 15K. The space characters most often appear in the start, end, and empty lines of the code. Everyone can select the code in the Dreamweaver and press the SHIFT key to align left. Remove the space, you can reduce the size of the Web page a lot, improve the speed of Web page opening.

2. Use Div Layout Web page

Many people in the production of Web pages using table, it may be for the simple layout and Web page compatibility, but the table layout does not have a clear hierarchical relationship, if the nested table nesting will also greatly increase the amount of code. The use of Div layout code can make the code more concise, Web site optimization effect will be more obvious.

3, the CSS style written to the external file, CSS writing using shorthand form

A lot of people for debugging convenience often use inline css (in the head area of the normal inline and in the inside of the label inline CSS), this will increase the content of the page is irrelevant code, not conducive to search engine quickly understand page information. We should make all the CSS in the external file, so that the page code is the most concise.

Many other CSS styles have shorthand methods, such as:. mycss {padding-top:10px; padding-right:5px; padding-bottom:10px; padding-left:3px; If you use shorthand, only need. mycss {padding:10px 5px 10px 3px;}, the specific shorthand style has those, we find the relevant CSS tutorial on it, online a lot.

Special attention to a point: not that the site used div must be equal to optimize the home, the hierarchical relationship between the div can not be ignored, directly affect the search engine on the page information block understanding! If you do not understand, you can refer to the SEO surprise blog page source code, page level relationship to see.

4, the use of more HTML tags, reduce the "class=xxx" this code. For example:

  

We can all use the following code:

  

As for the CSS style of the related elements, we only need to myul the UL style in the external CSS file. Myul li I,. Myul Li Span,. Myul li P define it.

5, reduce flash, if using JavaScript effect can replace the best

Flash is not well understood by search engines at present, and it is not compatible with Apple devices, so if your site needs it, it's best to animate it with JavaScript.

6. Reduce JavaScript

A lot of JavaScript will increase the volume of web pages, affecting the search engine Spiders crawl the page. If the page effect (for example: navigation bar, floating layer, etc.) can be replaced by div the best.

In particular, avoid many programmers like to do hyperlinks in JavaScript, unless you think that the link is not important, do not want to pass the next page weight.

7, on the server side of the Web page gzip compression

Enabling gzip compression on the server side reduces the volume of Web pages by 30%-80%, which is the most important optimization effect, and this feature requires server control support.

Finally remind everyone, if you want to do a good job of website originality, you'd better use the template of your own design, rather than using some of the popularity of the Internet template, which is most conducive to improving the effectiveness of the site optimization.

This article by the SEO Surprise (http://www.seoqibing.com) starting A5, reprint please keep information!

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.