flexbox

CSS-only masonry layout

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-20 11:36:11
问题 I need to implement a fairly run-off-the-mill masonry layout. However, for a number of reasons I don't want to use JavaScript to do it. Parameters: All elements have the same width Elements have a height that cannot be calculated server side (an image plus various amounts of text) I can live with a fixed number of columns if I have to there is a trivial solution to this that works in modern browsers, the column-count property. The problem with that solution is that elements are ordered in