Welcome...



...All those moments will be lost in time, like tears in rain....

- soliloquy from Blade Runner


Bits and bytes do get lost, awash in the rain of data flow that is Internet. They slip away from us, never to found again... some of them will be captured here, many more will not... like tears in rain...



Monday, October 22, 2012

Image sprites

 One of the ways to improve performance of the page is to use image sprites. Instead of having browser connect 10 times to get each individual image, you combine them all into one image and then use css to access individual images by getting their positions:

 Something like this:
 .sampleClass
{
  width: 22px;
  height: 25px;
 background-image: url(someimage.png);
 background-position: 6px 13 px;
bakcgrund-repeat: no-repeat;
}

Good site that allows you to do this visually and uses Html5/JQuery/CSS3 to boot to achieve this is:

http://www.spritebox.net/

You can play with sample pictures or with your own.

No comments:

Post a Comment