Building a gallery of thumbnails

So, I am wrestling with a gallery of thumbnails. Looking at Google Images, they manage to have images of a variety of widths line up with a set padding between each. I guess that just takes leaving off the width for the css rule handling each thumbnail?

But they also manage to center vertically any image less tall than the space allotted to each row. Is this possible in CSS or are they using Ajax or something else to accomplish this?

The thumbnails themselves don’t have a fixed height and width but I was thinking of having each row be a set height. That looks like it might work, thanks. :slight_smile:

Are you working with a set height and width for the parent?

If so you could do something like this:
http://www.pmob.co.uk/temp/caption24.htm

The image is centred vertically by setting the line-height to the same as the available height. Ie7 and under need the hack though.

Thank you. :slight_smile: It looks almost right, though it doesn’t have the vertical centering if elements that aren’t as tall as the max for each row.

Have a look half way down this page and see if that’s what you need:

http://gtwebdev.com/workshop/layout/inline-block-gallery.php

CSS certainly can handle this, if I understand what you are describing.