Reputation: 507
I have four divs side by side. I'd like the height of them to be the same, and stay the same if one of them resizes. means, if one grows because text is placed into it, the other one should grow to match the height.
Here is my :
Fiddle
Please resize the width of answer
Thank you.
Upvotes: 0
Views: 88
Reputation: 29
$(document).ready(function(){
var height;
var maxHeight = 0;
$(".test").each(function(){
height = $(this).height();
if(height > maxHeight) {
maxHeight = height;
}
});
$(".test").css("height",maxHeight);
});
By using jQuery
Upvotes: 1
Reputation: 808
here is your solution you should use display:flex
jsfiddle.net/94uvouzw/7/
Upvotes: 1