1. Use css sprites. The advantage is that the small images used in CSS can be merged into one large image, which reduces the requests to the server, reduces the server pressure, and speeds up page loading. 2. Merge multiple css files into a single css file. Same benefits as css sprites 3. Use external CSS. External CSS can be cached by browsers and is easy to maintain. 4. Put the css in the head. You can refer to Yahoo's document http://developer.yahoo.com/performance/rules.html#css_top 5. Use link instead of import Using import will slow down page loading. Moreover, the loading order in IE may be inconsistent with expectations, which will directly lead to display problems. 6. Use CSS abbreviations. For example, use margin instead of margin-top. 7. Put similar styles together to avoid repetitive writing. 8. Reduce line breaks. 9. Delete the final semicolon. 10. Use single-line comments. 11. RGB color abbreviation. 12. Remove unnecessary units, such as px. 13. Delete unused styles. It can reduce file size and shorten browser parsing and matching time. 14. Compress CSS files. All of the above are very simple and there is no need to explain them in detail. Of course, some CSS compression tools have optimization functions. |
<<: A guide to writing flexible, stable, high-quality HTML and CSS code standards
>>: WeChat applet implements search function and jumps to search results page
Table of contents 1. Two-way binding 2. Will the ...
mktemp Create temporary files or directories in a...
Docker image download is stuck or too slow I sear...
How can you find the location of the configuratio...
I have found a lot of online resources on this pro...
Table of contents What is two-way data binding Im...
one. wget https://dev.mysql.com/get/mysql57-commu...
Run cmd with administrator privileges slmgr /ipk ...
This article example shares the specific code of ...
Table of contents 1. Basic SELECT statement 1. Qu...
There are many form elements. Here is a brief sum...
Understanding of diff algorithm in React diff alg...
recommend: Navicat for MySQL 15 Registration and ...
Link: https://qydev.weixin.qq.com/wiki/index.php?...
This article example shares the specific code of ...