0

I'm looking for a way (css or js) to make a bunch of blocks (random height) flow like this: What I need

Meanwhile, the default behavior gives me this:

enter image description here

Any idea how to achieve this?

(Note that I'd like to keep the left-to-right order, and some kind of responsiveness)

Codepen: http://codepen.io/Trost/pen/ygMwJQ

.item{
  display: inline-block;
  background: grey;
  width: 100px;
  height: 100px; //height is variable
  margin: 5px;
}
Trost
  • 109
  • 10
  • This has been answered before, you're looking for a _"Pinterest"_ style layout. A lot of sites use [Masonry](http://masonry.desandro.com/) to achieve said layout. – hungerstar Jan 20 '17 at 20:56
  • Thanks, this helped! I didn't know the right term to google. – Trost Jan 22 '17 at 15:43

0 Answers0