1. Get the maximum height after getting their height, and then assign
var $divClass = $('.className');
var height = 0;
$divClass.each(function () {
if ($(this).height() > height) {
height = $(this).height();
}
});
$divClass.height(height);
2. Using the adaptive feature of table, each div is a td, and the td must be of equal height;
.wrapper{
display: table;
border-spacing: 20px; /* td间的间距*/
}
.wrapper > div {
display: table-cell;
width: 1000px; /*设置很大的宽度,table自动平分宽度 */
border-radius: 5px; /*这里设置圆角就正常了*/
}
3. Add a parent element to them and set display to flex layout;