【发布时间】:2016-12-18 20:53:22
【问题描述】:
使用引导程序,我创建了三列,每列包含一个图像和一个标题。像这样:
但是,我希望它实际输出这样的内容:
这是我当前的代码:
<!-- Section 6 -->
<div class="cssSection cssCenter">
<div class="container">
<h2>The Order</h2>
<br>
<p class="cssInformation">Labelled as a religious order, the Knights Templars established a set of rules by which their members would follow.</p>
<br>
<div class="row">
<div class="col-sm-4">
<img class="img-center img-responsive" src="http://placehold.it/400x275">
<br>
<p>The Templars swore to an oath of poverty, chastity, obedience and renounced the world.</p>
</div>
<div class="col-sm-4">
<img class="img-center img-responsive" src="http://placehold.it/400x275">
<br>
<p>The Templars lived within their own community, which meant sleeping in a common dorm, while also eating their meals in union. Lorem ipsum sont dolor sit amet. Lorem ipsum sont dolor sit amet.Lorem ipsum sont dolor sit amet.</p>
</div>
<div class="col-sm-4">
<img class="img-center img-responsive" src="http://placehold.it/400x275">
<br>
<p>The Templars refrained from becoming drunk, gambling and swearing</p>
</div>
</div>
</div>
</div>
这里是相关的 CSS 代码:
.cssSection {
padding: 45px 0 30px;
}
.cssCenter {
text-align: center;
}
.cssInformation {
font-size: 18px;
}
我可以在 HTML 和/或 CSS 中进行哪些调整以使 p 标签水平对齐而不影响图像?
【问题讨论】:
-
尝试添加“display:flex; align-items:stretch;”到 .row 类。
-
@ThomasByy 谢谢你成功了
标签: html css twitter-bootstrap alignment