How to make a ribbon photo like flickr or 500px?

Tell me how to do the same layout of photos with resize depending on the screen size as the feed sites flickr or 500px? Possible I would like the easiest and most lightweight option without jquery and without using the newfangled flex-box to work even on not the most modern browsers.
UPDATE: AND if you take into consideration that I know in advance the dimensions of the photo? The aspect ratio of all 3-to-2, height 300 pixels, width 200 or 450 for vertical and horizontal pictures respectively.
July 8th 19 at 11:51
3 answers
July 8th 19 at 11:53
July 8th 19 at 11:55
I have a friend one, a very good front-andseek.
He wrote that such a plugin
Quite easy and cool, I put on a couple of sites already.
Without jquery you is unlikely to correctly implement.
If there's a problem, on the website it ask.
July 8th 19 at 11:57
Google the word masonry

Find more questions by tags CSSHTML