【发布时间】:2019-01-13 20:07:16
【问题描述】:
使用 Bootstrap 4,我创建了一个 card-deck 和两个 cards。尽管两个cards 的高度相同,但由于其他元素的文本长度不同,元素不在同一个位置。
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<div class="card-deck">
<div class="card" style="margin-top: 0px">
<div class="card-body">
<a>
<img class="card-img" src="{{banner.FeatureImage0.Url}}" alt="Card image cap" style="width:200px; height: 132.531; float: right; margin-left:10px;">
</a>
<h5 class="card-title">Get to Know...FirstName LastName</h5>
<p class="card-text" style="margin-bottom: 20px;">In this interview we feature FirstName LastName, Community Relations and Social Responsibility Officer, Executive Vice President.</p>
<a class="btn btn-primary" style="color:white !important;">Read More</a>
</div>
</div>
<div class="card" style="margin-top: 0px">
<div class="card-body">
<a>
<img class="card-img" src="{{banner.FeatureImage0.Url}}" alt="Card image cap" style="width:200px; height: 132.531; float: right; margin-left:10px;">
</a>
<h5 class="card-title">Questions are more important than answers - August ethics message</h5>
<p class="card-text" style="margin-bottom: 20px;">The August ethics message comes from FirstName LastName, Wisconsin Region CEO.</p>
<a class="btn btn-primary" style="color:white !important;">Read More</a>
</div>
</div>
</div>
如何确保我的“阅读更多”按钮相互对齐?
【问题讨论】:
-
你可以给卡片一个
min-height,然后让阅读更多按钮出现在卡片的底部。
标签: html css twitter-bootstrap bootstrap-4