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. Introduction 2. Use 1. @Comp...
In the project, form testing is often encountered...
1. Installation Install using yum ##Automatically...
Table of contents Install Tomcat with Docker Use ...
1. Single machine environment construction# 1.1 D...
1. What is scaffolding? 1. Vue CLI Vue CLI is a c...
Error message: user: 'root' host: `localh...
Preface This article mainly introduces the releva...
An optimization solution when a single MYSQL serv...
When we make a gradient background color, we will...
Friends who have used the Linux system must have ...
How to create a service and auto-start it in Ubun...
1 Download MySQL8 from the official website and i...
How to create a Linux virtual machine in VMware a...
ElasticSearch cluster supports動態請求的方式and靜態配置文件to ...