CSS Document optimization

Source: Internet
Author: User

First understand the rendering logic of the next css, which is searched from the last digit of the tag, for example:. MyClass Li A, preferred it would traverse all the <a>, and then see which <a> had <li> before, and then see which <li> There were before. MyClass.

So: 1, too many levels will increase the workload of CSS rendering.

As follows:

Besides, what else can be optimized?

2, the figure of the style of each property exclusive row, the more the number of rows, the larger the size of the file, and find it is not easy to look for, into the crazy wheel mode.

3, long and long chain positioning,. MyClass Li A span allows unfamiliar colleagues to constantly switch between HTML and CSS documents to find the elements that affect productivity. It is recommended to use CLSS with a clear meaning.

4, some commonly used properties can be drawn away, normal team work, the front end and design will be in the design phase to develop before the development of some common style, such as: Font, title style and so on. There are a number of things that we would like to use, such as positioning, clearing floating properties, and so on.

The following are the optimized documents:

Of course, when the volume of the project is relatively small, the efficiency improvement will not be obvious. But more of the benefit is the subsequent maintenance of efficiency, after all, as a technology, the purpose of the work is to improve the company's income, reduce expenditure, this is the place of throttling.

Welcome to the exchange of guidance

CSS Document optimization

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.