Using image sprites in CSS




Using Image Sprites in CSS

In many cases, we may have to create websites with many bigger images may be a 

photography website or a tourism website. We may also use images for changing them on 

hover and on visited. Eventually using images in a website may generate more HTTP 

request. Moreover it may also take more time to load. In such scenarios we may use Image

 sprites.




Image sprite is a collection of images put  into a single image. It will reduce the number of 

HTTP request and reduce memory and bandwidth of the webpage.


The combined image will be called as ‘master image ’. While the web page is loaded 

instead of each and every image getting loaded, a single master image will be loaded in 

comparatively less time. After creating the master image by combining all the other images, 

the images can be displayed respectively by using background-position property in CSS 

defining the exact position of the image to be displayed. 


My experimentation of using image sprites is given at https://github.com/abinayagomathi/abinaya_works 

Comments

Popular posts from this blog

How to initialize Datatable plugin?

Datatables.net - Plugin options

What are some mistakes people make when they start learning HTML, CSS and JavaScript?