gpt4 book ai didi

css - 如何在 Bootstrap 4 的卡片组中设置每行卡片的数量

转载 作者:太空宇宙 更新时间:2023-11-04 05:59:50 24 4
gpt4 key购买 nike

我正在寻找在 Bootstrap 中设置卡片组中每行卡片数量的解决方案。

例如,我想每行有两张卡片:

<div class="card-deck">
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
</div>

最佳答案

这是你想要的吗??

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.css" rel="stylesheet" />

<div class="row">
<div class="card col-sm-6">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card col-sm-6">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card col-sm-6">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
<div class="card col-sm-6">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">
Card text
</p>
</div>
<div class="card-footer">
<small class="text-muted">Card footer text</small>
</div>
</div>
</div>

关于css - 如何在 Bootstrap 4 的卡片组中设置每行卡片的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57427261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com