bootstrap 3 中的等高列

equal height columns in bootstrap 3

我有以下 html:

<div class="container">
    <div class="row">
        <div class="col-md-2">
            <div class="phone-and-email">
                <p>+44 (0)7950 123 456 info@example.co.uk</p>
            </div>
        </div>
        <div class="col-md-10">
            <div class="icons">
                <div class="row">
                    <div class="col-md-4">
                        <img src="images/info.png" class="pull-left"/>
                        <p>How to buy</p>
                    </div>
                    <div class="col-md-4">
                        <img src="images/delivery.png" class="pull-left"/>
                        <p>Free Delivery</p>
                    </div>
                    <div class="col-md-4">
                        <img src="images/gift.png" class="pull-left"/>
                         <p>Gift Vouchers</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

css:

.phone-and-email, .icons {
    border-top: 2px black solid;
    border-bottom: 2px black solid;
}

我无法使左栏与右栏高度相同,我尝试了大约 5 种不同的解决方案。它确实可以使用 javascript,但如果可能的话我宁愿使用 css。

外观:

外观应该如何:

一种可能的解决方案是对行使用显示 table 并使用 table-cell 来实现两个网格部分的高度相等。

检查此 bootply

HTML:

<div class="container">
    <div id="onerow" class="row">
        <div class="col-md-2 sameheight">
            <div class="phone-and-email">
                <p>+44 (0)7950 123 456 info@example.co.uk</p>
            </div>
        </div>
        <div class="col-md-10 sameheight icons">
            <div>
                <div class="col-md-4">
                    <img src="http://www.bootply.com/assets/i_lovebootstrap.png" class="pull-left">
                    <p>How to buy</p>
                </div>
                <div class="col-md-4">
                    <img src="http://www.bootply.com/assets/i_lovebootstrap.png" class="pull-left">
                    <p>Free Delivery</p>
                </div>
                <div class="col-md-4">
                    <img src="http://www.bootply.com/assets/i_lovebootstrap.png" class="pull-left">
                    <p>Gift Vouchers</p>
                </div>
            </div>
        </div>
    </div>
</div>

CSS:

.phone-and-email, .icons {
    border-top: 2px black solid;
    border-bottom: 2px black solid;
}

img{
  height:20px;
  width:20px;
}

#onerow{
  display: table;
}

.sameheight {
    float: none;
    display: table-cell;
    vertical-align: top;
}