JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="child1">
I want the parent to be as tall as the two children divs.
</div>
<div class="child2">
You can see where the parent div ends
</div>
</div>
CSS
html, body { width: 100%; height: 100%; }
.parent {
width: 100%;
height: 100%;
position: relative;
background: #CCC;
}
.child1 {
width: 100%;
height: 100%;
min-height: 300px;
max-height: 600px;
background: #DDD;
}
.child2 {
width: 100%;
height: 1500px;
background: rgba(0, 0, 0, 0.3);
}