所以我有两列牌,每张牌都有(define (same-parity a .b)
(let ((remain (remainder a 2)))
(define (recur-part remain-list)
(cond ((= remain (remainder (car remain-list) 2))
(append remain-list (list (car remain-list)))
(recur-part (cdr remain-list)))
(else (recur-part (cdr remain-list)))))
(recur-part b)))
属性。每个都是可变高度,因此每张卡之间有不均匀的空白区域,如下所示:
如果没有两个独立的列,我怎样才能在每张卡之间获得间距?
我的目标是这种布局:
答案 0 :(得分:2)
使用column
布局,如下所示:
.cards {
columns: 300px 2;
}
.cards div {
display: inline-block;
}
或使用弹性布局:
.cards {
display: flex;
flex-direction: row; /* or column if you want them displayed vertically */
}
.cards div {
flex: 1 1 auto;
}
或者,如果您只是希望它们始终显示在顶部:
.cards div {
display: inline-block;
vertical-align: top;
}