CSS3 has been around for a long time, and it is still under development. The introduction, usage, and compliments of CSS3 on the Internet have spread a lot, and I have also introduced some in the previous articles. Is CSS3 really better than CSS2? What are the advantages?
This article draws on foreign authors' articles (the original text can be viewed at the bottom of the article), and analyzes the differences between CSS3 and CSS from a perspective other than CSS3 writing and working principles.
The author uses a page I made as an example to make the same page using two versions of CSS and CSS3 respectively, so that the effects of these two pages are almost the same, and then the two CSS files are compared.
First of all, I compare the production time. Using CSS3 to make a page is much more time-saving than using CSS. Because CSS3 can directly make many effects to replace images, and pages made with the old CSS version need to make some images to reflect the effect, it also takes a lot of time to make images.
Number of files, capacity, and loading time
Second, the author made a comparison in terms of file size and load time, as shown in Figure 1 above. The CSS3 version has a size of 5.2K, the total number of webpage files is 12, and the total capacity is 767.9K; the CSS version is 4.5K, but the total number of webpage files is 22, and the webpage capacity is 849.2K. The loading times are 3.3 seconds and 4.7 seconds, respectively. It can be seen from the above data that CSS3 is much leaner and faster than CSS.
Number of server requests
Another measure is the number of server requests. As many files as there are in a typical web page, the number of requests to the server. Don't underestimate this indicator. Many web authors explore CSS Sprite technology in order to reduce the load on the server. As shown in Figure 2 in the figure above, there are a total of 12 files in CSS3 and 22 files in the CSS version, so their requests to the server are 12 and 22, respectively. CSS3 wins again. Finally, based on the above data, CSS3 and CSS related data have been listed in Figure 3, and CSS3 wins. Now we can see that CSS3 has more advantages besides its beautiful effect. After all, it is a product of the development of network technology, and it will inevitably develop in a more simple, practical and beautiful direction.