Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Andre Romano
Andre Romano
8,809 Points

Spacing of different height element within grid layout( Masonry )

Hey all,

So I've been searching alot and cannot seem to find what im looking for.

Is it possible to achieve this effect without .js, horizontally sorted? http://isotope.metafizzy.co/layout-modes/masonry.html

The only .js free options are vertically sorted, like this: http://andyknapp.com/demo/learning-flexbox/

I really didn't want to have to use a .js lib just for a simple effect, btw dont need that many columns, maybe 2 or 3 are enough.


2 Answers

Andre Romano
Andre Romano
8,809 Points

Hmm ok that's what i though, thanks Nick anyway!

I don't think this would be possible without JS unfortunately. But I also don't think it's a bad thing to use a javascript library. Pretty much every website uses jQuery. If you're worried about it being too slow, try Zepto.js