I am trying to design a gallery with square elements of varying widths. I want the squares to fill free slots/space. I have seen this working using Bootstrap cards, however, I could only get this to work with verying heights.
Any tips?
This is an example of what I'd like to achieve:
The proposed answer does not answer this question as it explicitely states that all divs have the same width which is not the case here.