10

When simply doing float:left to all thumbnails of the same size, a gallery looks great. But when different size thumbnails come in to play, that is no longer the case.

What is the best way to handle different size thumbnails? Do I need to use tables instead?

example

mskfisher
  • 3,291
  • 4
  • 35
  • 48

4 Answers4

13

None of the possible CSS solutions look particularly good.

I recommend using JavaScript+jQuery instead, specifically one of these plugins:

thirtydot
  • 224,678
  • 48
  • 389
  • 349
4

I think the best solution is to give each thumbnail a div container with a fixed size, so that every thumbnail takes the same space. I mean, don't resize your thumbnails. The picture in the div should be centered.

Glen Selle
  • 3,966
  • 4
  • 37
  • 59
dknaack
  • 60,192
  • 27
  • 155
  • 202
2

I have used following plugin, it's working fine :

http://suprb.com/apps/gridalicious/

  • 1
    Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Oct 08 '13 at 11:40
0

For those in 2017 looking for a gallery for different sized images, check this css-tricks article: https://css-tricks.com/seamless-responsive-photo-grid/