Bootstrap 3个相同高度的缩略图(就像bootstrap 4中的高度相同的卡片)

Noi*_*art 3 twitter-bootstrap-3 twitter-bootstrap-4

我有一排像这样的缩略图:

我希望他们的身高相等.这是我的代码:

<div class="row text-center">
    <div class="col-md-3 col-sm-6">
        <div class="thumbnail">
            <div class="caption">
                <h3>HOTKEY + COMBO</h3>
                <p>Hotkey description goes here. Category only shown in explore.</p>
                <p>
                    <a href="#" class="btn btn-default" data-tooltip="Change Hotkey">
                </p>
            </div>
        </div>
    </div>
    <div class="col-md-3 col-sm-6">
        <div class="thumbnail">
            <div class="caption">
                <h3>HOTKEY + COMBO</h3>
                <p>short desc</p>
                <p>
                    <a href="#" class="btn btn-default" data-tooltip="Change Hotkey">
                </p>
            </div>
        </div>
    </div>
    <div class="col-md-3 col-sm-6 hotkey-add">
        <div class="thumbnail">
            <div class="caption">
                <p></p>
                <p><a href="#" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span></a></p>
            </div>
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这可能吗?就像我们在bootstrap4中看到的,这里是相同的高度卡:

http://www.codeply.com/render/KrUO8QpyXP#

Zim*_*Zim 9

我知道我有点迟到了,但我认为最好的方法是flexbox.以下是它在Bootstrap 3中的工作方式:

.row.display-flex {
  display: flex;
  flex-wrap: wrap;
}
.thumbnail {
  height: 100%;
}
Run Code Online (Sandbox Code Playgroud)

只需添加display-flex到包含row.此外,即将推出的Bootstrap 4默认使用flexbox,因此将来不需要额外的CSS.

Flexbox的缩略图

您还可以使用子元素位置做更多事情.


另请参阅, 使Bootstrap列的高度相同