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