【发布时间】:2021-05-29 15:31:24
【问题描述】:
在下图中,您可以看到“Colton Smith”分两行出现。我应该怎么做才能防止这种情况发生?我想显示在同一行。 这是我的代码
<div class="row mt-5" id='imag'>
<div class="col-lg-4">
<div class="row">
<div class="col-lg-1">
<img src="images/image-colton.jpg" alt="" />
</div>
<div class="col-lg-3" id="intro">
<h6>Colton Smith</h6>
<h6>Verified Buyer</h6>
</div>
</div>
<div class="row">
<p>
"We needed the same printed design as the one we had ordered aweek prior. Not only did they find the original order, but we alsoreceived it in time. Excellent!"
</p>
</div>
</div>
</div>
【问题讨论】:
-
我假设这是引导程序,类 col-lg-3 限制元素宽度以适应其宽度内的所有内容。 col-lg-1 将恰好占据其父级宽度的 8.3%,即行,因此您的 col-lg-3 占用了大约 25% 的父行,因此您需要使用更大的元素来增加该元素的宽度col 类。
标签: html css line-breaks