JSFiddle - React, Tailwind, and code Playground
HTML
<div id='parent-div'>
<div id='child-div'>
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
test <br />
</div>
</div>
CSS
#parent-div{
min-height:400px;
width:250px;
background-color:#333;
position:relative;
}
#child-div{
position:absolute;
height:auto;
top: 0%;
}
JavaScript
$().ready(function(){
ch = $('#child-div').height();
$('#parent-div').css({
height : ch + 50 + 'px'
})
});