【问题标题】:Why are my bootstrap cards aligned on top of each other and not side by side across the page?为什么我的引导卡相互对齐,而不是在页面上并排?
【发布时间】:2020-08-13 23:03:25
【问题描述】:

为什么我的引导卡在页面上相互对齐而不是并排?

这是我拥有的 html。网站的其余部分工作正常。不确定这些卡片有什么问题,以及为什么它们不能并排对齐。

<div class="container-fluid padding">
<div id="row" class="row padding">
    <div class="col-md-4">
        <div class="card">
            <img class="card-img-top" src="grow.png">
                <div class="card-body">
                <h4 class="card-title">John Doe</h4>
                <p>This is just going to be information about about
                the company and wh
                </p>
                <a href="#" class="btn btn-outline-secondary">See Profile</a>
                </div>
        </div>
    </div>
</div>


    <div class="col-md-4">
        <div class="card">
            <img class="card-img-top" src="grow.png">
                <div class="card-body">
                <h4 class="card-title">John Doe</h4>
                <p>This is just going to be information about about
                the company and wh
                </p>
                <a href="#" class="btn btn-outline-secondary">See Profile</a>
                </div>
        </div>
    </div>


    <div class="col-md-4">
        <div class="card">
            <img class="card-img-top" src="grow.png">
                <div class="card-body">
                <h4 class="card-title">John Doe</h4>
                <p>This is just going to be information about about
                the company and wh
                </p>
                <a href="#" class="btn btn-outline-secondary">See Profile</a>
                </div>
        </div>
    </div>

</div>
 

【问题讨论】:

    标签: html bootstrap-4


    【解决方案1】:

    您忘记关闭 div 标签。这应该可以。

     <div class="container-fluid padding">
      <div id="row" class="row padding">
        <div class="col-md-4">
          <div class="card">
            <img class="card-img-top" src="grow.png" />
            <div class="card-body">
              <h4 class="card-title">John Doe</h4>
              <p>
                This is just going to be information about about the company and
                wh
              </p>
              <a href="#" class="btn btn-outline-secondary">See Profile</a>
            </div>
          </div>
        </div>
    
        <div class="col-md-4">
          <div class="card">
            <img class="card-img-top" src="grow.png" />
            <div class="card-body">
              <h4 class="card-title">John Doe</h4>
              <p>
                This is just going to be information about about the company and
                wh
              </p>
              <a href="#" class="btn btn-outline-secondary">See Profile</a>
            </div>
          </div>
        </div>
    
        <div class="col-md-4">
          <div class="card">
            <img class="card-img-top" src="grow.png" />
            <div class="card-body">
              <h4 class="card-title">John Doe</h4>
              <p>
                This is just going to be information about about the company and
                wh
              </p>
              <a href="#" class="btn btn-outline-secondary">See Profile</a>
            </div>
          </div>
        </div>
      </div>
    </div>
    

    【讨论】:

    • 太棒了。不要忘记接受答案并投票。
    猜你喜欢
    • 2021-06-27
    • 2021-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-07
    • 2018-06-09
    • 1970-01-01
    • 2012-08-11
    相关资源
    最近更新 更多