I wrote this codepen that does not work.
HTML
<div class="a">
<div class="b"> variable content length variable content length variable content length variable content length variable content length variable content length variable content length
<div class="c"> </div>
</div>
</div>
CSS
.a{
height: 500px;
width: 70px;
}
.c{
height: 50%;
background-color: red;
display: inline-block;
}
a is just a container b is the content div with variable content size.
is there a way to do it? c can have whatever position
as well. But: .c
must be half the size of its variable parent