JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent fixed">
<div class="child">My parent has <code>height: 1px</code>!</div>
</div>
<div class="parent">
<div class="child">My parent has only <code>min-height: 10em</code>!</div>
</div>
CSS
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
padding: 1em;
}
.parent {
width: 49%;
float: right;
min-height: 10em;
background: deepskyblue;
font-family: Helvetica, Arial, sans-serif;
}
.parent.fixed {
float: left;
}
.fixed {
height: 1px;
}
.child {
padding: .25em;
background: tomato;
height: 100%;
}