是否可以增加 bootstrap-4 卡列数? https://plnkr.co/edit/oIapj1imlMQ1M4vo1O5R?p=preview
这仅显示推到左侧的 3 列,右侧剩余 3 列为空。我将此 sass 放在 bootstrap-4 默认样式之后:
.card-columns {
// sm
@media (min-width: 576px) {
column-count: 3;
}
// md
@media (min-width: 768px) {
column-count: 4;
}
// lg
@media (min-width: 992px) {
column-count: 5;
}
// xl
@media (min-width: 1200px) {
column-count: 6;
}
}
我看到的所有示例都没有成功增加列数,即使使用 sass 也是如此。如果你知道怎么做,你会发布一个简单的例子来证明它是可能的吗?
最佳答案
这个引导解决方案有缺陷。这还不是万无一失的解决方案。您可以阅读here .
Why not work if increase the default
column-count: value;
?
因为.card
class
包含display: ***;
和width: ***;
属性(property)。您应该针对此 column-count:
问题编写自定义 CSS
。您需要阅读此article 。例子是here .
My personal suggestion is avoid this css solution from production site. Hope this help.
关于css - Bootstrap 4 增加卡片列数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47600465/