JSFiddle - React, Tailwind, and code Playground
HTML
<div class="div1"></div>
<div class="div2"></div>
CSS
*{margin:0;}
div{
position:absolute;
width:100%;
left:0;
}
.div1{
top:0;
height:25%;
background:#f33;
}
.div2{
top:25%;
background:#3cf;
transition:height 1s;
}
JavaScript
function changeHeight(){
var height = $(".div1").height();
$(".div2").css({"height":""+ height +""});
}
window.addEventListener('resize', changeHeight);
changeHeight();