这是一个使用换行列的选项,但它需要固定的高度。
.card-container { display: flex; flex-flow: column wrap; height:100vh; align-items: center; background-color: #888;}.masonry { -moz-column-count: 4; -webkit-column-count: 4; column-count: 4; -moz-column-gap: 1em; -webkit-column-gap: 1em; column-gap: 1em;}.item { background-color: #eee; display: inline-block; margin: 0 0 1em; width: 100%;}


