JSFiddle - React, Tailwind, and code Playground
HTML
<div id='square'>
<div id='rectangle' /></div>
CSS
#square {
position:relative;
height:100px;
width:100px;
background:red;
}
#rectangle {
position:absolute;
width:50px;
background:blue;
height:100%;
}