Twitter bootstrap 引导4卡行?
我正在使用Bootstrap4中的卡片组类。我希望h4在卡中img缩略图类的右侧对齐Twitter bootstrap 引导4卡行?,twitter-bootstrap,bootstrap-4,Twitter Bootstrap,Bootstrap 4,我正在使用Bootstrap4中的卡片组类。我希望h4在卡中img缩略图类的右侧对齐 <div class="card-deck"> <div class="card"> <img class="img-thumbnail" src="img/camera.svg" alt="IMG ALT TEXT"> <h4 cla
<div class="card-deck">
<div class="card">
<img class="img-thumbnail" src="img/camera.svg" alt="IMG ALT TEXT">
<h4 class="card-title">Header</h4>
<div class="card-block">
<p class="card-text">More Text Here</p>
</div>
</div>
标题
此处有更多文本
只需给类一个宽度
。img缩略图
,因为默认情况下img采用最大宽度:100%
您必须定义宽度
和文本对齐:右编码>到类.card title
中,并将它们包装成一个div并给出它
.card-heading {
display: flex;
justify-content: space-between;
align-items: center;
}
。卡片标题{
显示器:flex;
证明内容:之间的空间;
对齐项目:居中;
}
.img缩略图{
宽度:50px;
}
.名片名称{
文本对齐:右对齐;
}
标题
此处有更多文本
您的意思是要将标题与右侧对齐?正确。我希望img缩略图与左上角对齐,h4与右上角对齐,我仍然遇到同样的问题。h4显示在img缩略图下方的行中,而不是旁边。你可以点击蓝色的“运行代码”按钮,看到你自己和其他人在一起。你可以再次点击并检查是否成功!谢谢