The Masonry JS library is freakin’ awesome.

Just be sure to define your widths and gutters as percentage.

HTML …

CSS …
JS …