我正在尝试在两个卡片组之间添加空间。我正在使用bootstrap 4 alpha 6.我不知道为什么在第二张卡牌上使用mt-20
不会这样做。我已经尝试将它们包装成行并执行它,但是也没有这样做:
<div>
<div class="container">
<div class="card-deck">
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">Permits</h4>
<p class="card-text">
Apply for parking permit<br />
View existing permit requests<br />
Activate Visitor permits<br />
</p>
</div>
<div class="card-footer">
@Html.ActionLink("Permits", "Index", "Home", new { Area = "Permit" }, new { @class = "btn btn-primary" })
</div>
</div>
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">Vehicles</h4>
<p class="card-text">
View and manage your vehicles
</p>
</div>
<div class="card-footer">
@Html.ActionLink("My Vehicles", "Index", "Vehicle", null, new { @class = "btn btn-primary" })
</div>
</div>
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">Parking Tickets</h4>
<p class="card-text">
View your parking ticket history
</p>
</div>
<div class="card-footer">
@Html.ActionLink("My Tickets", "Index", "ParkingTicket", null, new { @class = "btn btn-primary" })
</div>
</div>
</div>
<div class="card-deck mt-20">
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">Funding Options</h4>
<p class="card-text">
Add credit/debit card<br />
Top up Account<br />
Manage cards
</p>
</div>
<div class="card-footer">
@Html.ActionLink("Funding Options", "Index", "Funding", null, new { @class = "btn btn-primary" })
</div>
</div>
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">Account History</h4>
<p class="card-text">
View all financial transactions on my account
</p>
</div>
<div class="card-footer">
@Html.ActionLink("Account transactions", "Index", "Activity", null, new { @class = "btn btn-primary" })
</div>
</div>
<div class="card text-center">
<div class="card-block">
<h4 class="card-title">User Settings</h4>
<p class="card-text">
Edit personal details<br />
Change top-up settings<br />
Change password
</p>
</div>
<div class="card-footer">
@Html.ActionLink("Personal details", "Update", "Account", null, new { @class = "btn btn-primary" })
</div>
</div>
</div>
</div>
答案 0 :(得分:29)
Bootstrap 4中没有mt-20
。引导程序4 margin classes是......
<强>米{两侧} - {大小} 强>
尺寸 来自 0-5 ,且尺寸是1rem
的默认间隔单位的一部分
.25rem
.5rem
1rem
1.5rem
3rem
因此,您可以使用mt-3
,mt-4
,mt-5
等。
答案 1 :(得分:1)
你可以在卡片下面换行:<br />
。或者可以在card-deck
类下添加底部边距:
.card-deck{
bottom-margin: 10px;
}