Is it appropriate to use a sprite picture or to convert it to base64 for a small picture?

I have 45 small images, each of which is about 1-3kb, which needs to be displayed once on the page. Whether I make a sprite image to display with a background image or directly convert it to base64 and display it with an img tag, which has better performance. Please analyze it

Jun.14,2021

your situation should be better than sprite. One card is 2k, there is also 90k, a load can be cached locally. Because html is generally not cached, img has to be reloaded every time you put it. In addition, bese64 will increase the volume by about 1 stroke 3.
generally speaking, I am a sprite for a whole set of small icons, and some scattered ones that are not in the whole set will use a base64. A project with a total of several small icons will also use a base64


. It is hard to say that a sprite image integrates multiple small images into a large image, and there is an asynchronous request to fetch an image. Base64 is to attach resources directly to css or html, without additional requests, but css or html files become larger. To sum up, relatively speaking, when loading a large image, the performance of the sprite may be better (the html page is faster), and vice versa is base64.


use the img tag to display sprite images? No one seems to do this. How do you locate background if you have position,img? Of course, maybe the latest technology can implement

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34d93-2bf4d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34d93-2bf4d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?