The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS thumbnails in the markup or in sprites

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #36377

    i once asked if i should use sprites or not.
    heres my problem.
    i have 9 thumbnails of pictures. when clicked a lightbox opens a bigger picture.

    originally i used img. in the html markup.
    if i am to change them over to a sprite my html would be fine but my css would grow a lot…

    thumbnail li{
    background: url(blah blah..)

    background-position: etc….

    background-position: etc….

    all the way to 9!

    quite annoying… is this still worth it and should my thumbnails not be in the markup?


    it is indeed very annoying, but i believe it may be worth it (mainly just to cut down on server requests). there are some tools that make it easier though!

    here’s one i’ve used a few times:
    mr coyier himself did this excellent screencast showing how to use it:

    another approach (one i havnt tried yet, but probably will soon) is to use css preprocessing with compass/sass. check it out here:


    ? really? i mean i have the thumbnails in a grid with padding and margins….
    how does that work?
    is this black magic!?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.