If you’re a web designer who’s looking for an approach to reduce the number of requests made by the browser, then you should examine the vast terrain of CSS sprites. Welcome to the final part of the series “Using CSS Sprites.” This three-part series shows you how to incorporate them into real world applications, and provides you with a respectable set of practical examples on the topic.
Creating a Basic Image Gallery with CSS Sprites (Page 1 of 4 )
This series contains two preceding articles, which were aimed at demonstrating how the concept of CSS sprites can be applied in two specific cases that possibly will be quite familiar to you: creating rollover buttons and dynamic banners.
Although these two concrete applications may seem rather primitive at first glance, they illustrated how CSS sprites can be utilized in a smart way. As you saw either in the case of the mentioned rollovers, or the banner, appropriate planning and design of the background images that comprise this pair of elements was indeed effective for eliminating the delay often noticeable when the browser has to download multiple pictures from the web server.
So far, so good. Now that you know how to take advantage of the useful capabilities that CSS sprites offer, it's a good time to tackle the last part of this hopefully instructive journey. In accordance with this premise, in this final article of the series, I'm going to extend the use of CSS sprites even more by applying this schema to building a basic image gallery.
I don't intend to replace a full-featured image system with one based upon CSS sprites, but I do want you to take a look at the small application that I'm going to build in the course of the next few lines. It will give you a better idea of how some basic CSS sprites can be quite handy for displaying thumbnails and large pictures as well.
Let's no waste more time in preliminaries and start learning how to use CSS sprites to create a small-sized image gallery. Let's go!