B
B
bismoney2015-11-18 13:21:51
PHP
bismoney, 2015-11-18 13:21:51

Blocks of different widths?

Hello. Tell me how such logic can be implemented in rails, or rather block calculation.
For example, there are blocks equal in width and height (picture below)
Everything is ok.
Hefvd.jpg
Further, for example, 1 becomes equal in width to two small ones
kheNR.jpg
. But when, when adding one more, for example, a small one, this large one goes down accordingly.
54gax.jpg
At the same time, 3 small and an empty block remain on top. How do others do it? How do they get so that with such a mixture at the top there are 4 blocks and not 3?
A vivid example of where this is normal is the site www.the-village.ru
Please tell me how they do it? Somehow they calculate how many blocks in width or what?
I will be very grateful for advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Ksenia Mikhailova, 2015-11-18
@bismoney

masonry
isotope

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question