How to create a Pinterest like gallery
I was recently working on a small photo gallery for one of my sites. Having images with various dimensions I quickly ran into trouble aligning the photos nicely with CSS alone. What I wanted was for the photos to align like they do in Pinterest; flowing smoothly next to each other despite being of various size. So I seeked out a solution that did just that.
This illustration below is rather self explanatory and shows the problem with aligning various sized images using CSS alone.