Bootstrap图像大小不同

时间:2014-10-29 20:05:42

标签: html image css3 twitter-bootstrap-3

我的Bootstrap css有问题。我有一个带有标题,正文和页脚的面板。身体包含一个图像。每个图像都已调整为相同的700px宽度和450px高度。然而,面板的尺寸不同,页脚没有相互对齐。

如何解决这个问题?

.cshtm代码:

 <div class="col-md-4 col-sm-6">
        <div class="panel">
            <div class="panel-heading">
                Visual Similarity Duplicate Image Finder
            </div>
            <div class="panel-body">
                <a href="portfolio-item.html">
                    <img class="img-responsive img-blog img-hover" src="@ViewBag.AccreditationImage2" alt="">
                </a>
            </div>
            <div class="panel-footer">
                <p>Accreditation test Progress: 10%</p>
                <p>Version: 5.5.0.1</p>
                <p>Vendor: MindGems, Inc.</p>
            </div>
        </div>
    </div>

和无处不在的形象: enter image description here

更新

事实证明,尽管图像的大小都相同,但图像的自然高度确实不同。无论如何,我如何强制面板中的图像大小相同?

1 个答案:

答案 0 :(得分:1)

在没有看到css的情况下,无法告诉您案例中发生的事情,但您应该只能在图片或容器上设置height属性:

<style>
.panel-body {
    height : 450px
}
</style>

或:

<style>
   .panel-body img {
        height : 450px
    }
</style>
相关问题