【问题标题】:How to set image in same height using bootstrap?如何使用引导程序将图像设置为相同高度?
【发布时间】:2020-06-04 17:48:42
【问题描述】:

我试图为所有卡放置相同尺寸的图像,但有些图像的高度已经很小,那么我该如何解决这个问题?

<div class="row">
    <div class="col">
        <div class="card h-100" style="width: 18rem;">
            <img class="card-img-top" src="/assets/prewedding/pic1.jpg">
        </div>
    </div>
    <div class="col">
        <div class="card h-100" style="width: 18rem;">
            <img class="card-img-top" src="/assets/prewedding/pic2.jpg">
        </div>
    </div>
</div>

【问题讨论】:

    标签: css angular-ui-bootstrap


    【解决方案1】:

    你只需要设置img覆盖容器,就像

    .card > img {
        width: 100%;
        height: 100%;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-27
      • 2019-08-26
      • 2020-01-15
      • 2020-12-25
      • 1970-01-01
      • 2020-02-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多