As you can see in the image every box has a different height and there are some boxes with double width.
Is it possible to create a masonry-style layout only with CSS?
As you can see in the image every box has a different height and there are some boxes with double width.
Is it possible to create a masonry-style layout only with CSS?
I'm working on a site right now with the same kind of layout, two columns with the occasional double-wide box. What I do is just separate the double-wide from the rest of the content. For example:
Then you can apply the CSS3 column solution to just the
two-columns
class. If you need to support IE9 you'll sadly need to add a JavaScript fallback.With css3 support you could do this:
http://jsfiddle.net/huAxS/2/
With no css3 support, you have to resort to js unfortunately.