Các giải pháp trên đều hoạt động cho đến khi bạn thêm các nút bootstrap đẹp! Làm thế nào để bạn vị trí nút tôi nghĩ (có, đó là vấn đề của tôi).
tôi kết hợp CSS với câu trả lời jquery từ How might I force a floating DIV to match the height of another floating DIV?
Sau một chút frigging tôi nhận này, mà làm việc với CSS mặc dù các nút không xếp hàng, và là tốt với jQuery
Feel miễn phí để sửa chữa các dòng nút CSS lên chút :)
jQuery:
$.fn.equalHeights = function (px) {
$(this).each(function() {
var currentTallest = 0;
$(this).children().each(function (i) {
if ($(this).height() > currentTallest) {
currentTallest = $(this).height();
}
});
if (!px && Number.prototype.pxToEm) {
currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
}
// for ie6, set height since min-height isn't supported
if ($.browser.msie && $.browser.version == 6.0) {
$(this).children().css({
'height': currentTallest
});
}
$(this).children().css({
'min-height': currentTallest + 40 // THIS IS A FRIG - works for jquery but doesn't help CSS only
});
});
return this;
};
$(document).ready(function() {
var btnstyle = {
position : 'absolute',
bottom : '5px',
left : '10px'
};
$('.btn').css(btnstyle);
var colstyle = {
marginBottom : '0px',
paddingBottom : '0px',
backgroundColor : '#fbf'
};
$('.col').css(colstyle);
$('.row-fluid').equalHeights();
});
CSS
.col {
margin-bottom: -99999px;
padding-bottom: 99999px;
background-color:#ffb;
position:relative;
}
.col-wrap {
overflow: hidden;
}
.btn{
margin-left:10px ;
}
p:last-child {
margin-bottom:20px ;
}
jsfiddle - http://jsfiddle.net/brianlmerritt/k8Bkm/
Đơn giản. Dễ dàng. [Cột chiều cao bằng Flexbox] (http://stackoverflow.com/a/33815389/3597276). –