Using CSS and flexbox, I don\'t understand how to give the same height to divs \"a\" and \"b\". I need b to become taller so as to match a\'s height. In other words, the gre
I solved the problem in javascript as follows, but I am still interested in a css solution:
function computeMaxHeight(els) {
var ht = 0;
els.forEach(function (el) {
var elht = el.height();
if (elht > ht) {
ht = elht;
}
});
return ht;
}
function setMinMeight(els) {
var maxht = computeMaxHeight(els);
//console.log("here resize. maxht = " + maxht);
els.forEach(function (el) {
el.css('min-height', maxht);
});
}
$(document).ready(function () {
var els = [$("#non-porre-limiti"), $("#we-love-pagi"), $("#vuoto"), $("#pagiletter"), $("#pagi-focus")];
$(window).on('resize', function () {
setMinMeight(els);
});
setMinMeight(els);
});
fiddle: http://jsfiddle.net/s2b0v4ph/3/