【发布时间】:2017-09-30 11:55:01
【问题描述】:
我正在尝试使用带有 Angular ngFor 的 Bootstrap 4 的卡组功能。
这是我现在拥有的 HTML,但在插入 3 个项目后我找不到如何换行:
<div class="row card-group">
<div *ngFor="let presentation of presentations" class="col-4 card">
<a [routerLink]="['/presentation', presentation._id]">{{presentation.title}}</a>
</div>
</div>
我看到其他答案说要使用 clearfix 类,但这对我来说到目前为止还没有用。
【问题讨论】:
-
为什么使用
card-group?它不允许像 row>col 那样包装。 -
@zimSystem 因为我希望卡片在每一行中具有相同的高度。所以我基本上想要多行卡片组
-
row的高度已经相同,因为 BS4 使用了 flexbox。你不需要迭代row。
标签: twitter-bootstrap angular bootstrap-4 ngfor