【问题标题】:How do I prevent automatic line break in my heading tag?如何防止标题标签中的自动换行符?
【发布时间】: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>

here is the image of above code

【问题讨论】:

  • 我假设这是引导程序,类 col-lg-3 限制元素宽度以适应其宽度内的所有内容。 col-lg-1 将恰好占据其父级宽度的 8.3%,即行,因此您的 col-lg-3 占用了大约 25% 的父行,因此您需要使用更大的元素来增加该元素的宽度col 类。

标签: html css line-breaks


【解决方案1】:

在您的代码中将&lt;div class="col-lg-3" id="intro"&gt; 更改为&lt;div class="col-lg-11" id="intro"&gt;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-02
    • 2014-03-23
    • 2019-09-23
    • 1970-01-01
    • 2013-10-29
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    相关资源
    最近更新 更多