One way to fix them all: why are Facebook and AddThis doing this?

Possible duplicate:
One image file for storing all small images on a page

Hey,

Facebook saves all the graphics on its page in one image . So AddThis . Why are they doing this? How can I use the same methods and crop images using JavaScript?

+4
source share
2 answers

They do this so that they can save connection overhead (otherwise, browsers would open the connection for each individual image ~ if it weren’t).

You don't need javascript to break the image: use standard CSS positioning to show specific parts of the image.

+4
source

they are called CSS Sprites . This reduces the number of requests made to load the page, thereby reducing the loading time. A site can simply set the background for something to be a small part of the image.

+5
source

Source: https://habr.com/ru/post/1338584/


All Articles