【发布时间】:2019-12-28 02:08:29
【问题描述】:
我正在尝试将 div 类“行”中的内容水平居中。我尝试过使用 justify-content-center 和其他变体。
<div class="container">
<div class="row">
<div class="col-md-4 portfolio-item">
<h3>
<a href="#">Text</a>
</h3>
<p>
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.
</p>
<p>
Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy.
</p>
</div>
<div class="col-md-4 portfolio-item">
<a href="#" target="_blank">
<img class="img-responsive" srcset="icon.png 1x, iconRetina.png 2x">
</a>
<a href="#" target="_blank">
<img class="img-responsive" srcset="downloadOnAppStore.png 1x, downloadOnAppStoreRetina.png 2x">
</a>
</div>
</div>
</div>
我可以看到答案是如何以内容为中心的,但这并不是我的意思。无论页面有多宽,我都希望内容大小的宽度与页面中心对齐。
问题似乎是列占据了行宽的 50%。
【问题讨论】:
-
那个好像没有效果
标签: html css bootstrap-4