html - Bootstrap - 如何在卡之间添加空间
问题描述
我试图在我的卡片之间放置空间。
我有 4 张卡并排。但是当我mr-3
在卡片 div 上使用时,最后一张卡片在下面。我不希望这种情况发生。
如何将所有 4 张卡片与它们之间的空格保持在同一行/行中?
我也试过d-flex justify-content-around
,但它不起作用。
下面是我的代码
<div class="container">
<div class="row">
<div class="card col-md-3">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card col-md-3">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card col-md-3">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div class="card col-md-3">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
解决方案
把卡放在一个col...然后试试
卡片,卡片组,卡片列没有响应功能
推荐阅读
- selenium - 自从我更新到 Firefox 63 以来,Firefox 配置文件正在抛出 Selenium WebDriverException
- spring - 如何将临时 PDF/CSV 从后端(Spring)传输到前端(Angular)?
- android - 统一按输入字段时Android键盘不显示?
- python - 如何使用 Python 3 拆分/解析文本文件(单个列表)的内容并将其写入多个列表?
- swift - 我可以在没有 Xcode 的情况下编写 Apple Metal 图形吗?
- package - 在设置 Chocolateyinstall.ps1 以将路径环境变量与程序文件链接时遇到问题
- python - 更简单的方法来检查两个不同的字符串是否在python的第三个字符串中
- c# - 从登录表单 C# 控制所有控件
- java - LWJGL 在同一着色器类中有 2 个着色器程序仅链接 1 个着色器
- c - C 宏数据库 - 在另一个宏中测试宏函数的参数