linda_a — 2010-09-13T19:24:44-04:00 — #1
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?
linda_a — 2010-09-16T06:27:24-04:00 — #2
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.
paulob — 2010-09-14T11:25:37-04:00 — #3
Are you working with a set height and width for the parent?
If so you could do something like this:
The image is centred vertically by setting the line-height to the same as the available height. Ie7 and under need the hack though.
linda_a — 2010-09-14T10:23:24-04:00 — #4
Thank you. 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.
ralphm — 2010-09-13T19:44:46-04:00 — #5
Have a look half way down this page and see if that's what you need:
CSS certainly can handle this, if I understand what you are describing.