5 ms·
CSS grid can do this! Sure not as freedom as a JS implementation but its good enough in 95% of scenarios in my experience! https://codepen.io/balazs_sziklai/pen
by jonnyscholes 9y ago
CSS grid can do this! Sure not as freedom as a JS implementation but its good enough in 95% of scenarios in my experience! https://codepen.io/balazs_sziklai/pen/mOwoLg https://codepen.io/balazs_sziklai/pen/mOwoLg (not my code - just one of the examples on codepen)
- colept 9y agoSorry, but this is not true masonry because the heights of the items are fixed. Masonry layouts have dynamic height elements.
- jonnyscholes 9y agoSorry I just linked to the first one that looked right as I was on the move. Flexible height is definitely possible as we're using it that in prod. Here's another examplei found with working flexible height :) https://codepen.io/Kseso/pen/ZJbEMe/ https://codepen.io/Kseso/pen/ZJbEMe/