JSFiddle - React, Tailwind, and code Playground
by victorxpp
HTML
<div class="container">
<div class="box1">Box 1</div>
<div class="box2">Box 2</div>
<div style="clear:both;"></div>
</div>
CSS
.container {height:auto; background:yellow; display:block; float:left; padding:40px 0; width:100%;}
.box1 {position:fixed; background:red; height:4590px;}
.box2 {position:absolute; background:green; margin-top:20px; height:200px;}
JavaScript
var biggestHeight = "0";
$(".container *").each(function(){
if ($(this).height() > biggestHeight ) {
biggestHeight = $(this).height()
}
});
$(".container").height(biggestHeight);