Mobile app version of vmapp.org
Login or Join
Bryan171

: Various elements in a single image? When I go to View Page Info -> Media in the Mozilla Firefox (or any other gecko-based browser). I see one picture there which contains several elements of

@Bryan171

Posted in: #Images

When I go to View Page Info -> Media in the Mozilla Firefox (or any other gecko-based browser).

I see one picture there which contains several elements of the site:



My questions are:


How they get separated when rendering the website?
(I know it's probably CSS, what I mean is how to define/know which region of this picture is a separated element)
What are the advantages over using one picture for each element?


I would guess this lowers the bandwidth as it has less headers, but I don't know if there is something else about it.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Bryan171

1 Comments

Sorted by latest first Latest Oldest Best

 

@YK1175434

Here are the sprites CSS of a site. They are useful to display little pictos (=icons) in a site.

The main advantage is the browser only loads one big image with all the pictos (performance because of less requests to the server). And to display these pictos separately, you just move a cursor with a fixed size in this big image.

Another advantage is also when you change a picto when an user action occurs, the picto is already loaded and you don't see the new picto blinking.

However, sprites CSS mustn't be used to display images related to the content of a site.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme