I have been grappling with this straightforward issue for quite some time now. It seems to be a unique problem as I couldn't uncover a similar one online.
My goal is to set the height of the green bar to 100% (to match the height of the red parent element).
If it helps, here is a link to the codepen: https://codepen.io/tartie2/pen/NWYZpgj
Below is the relevant code snippet:
div {
background-color:red;
height:200px;
width:300px;
position: relative;
overflow: auto;
}
div::after{
content: '';
position:absolute;
top: 0;
left: 0;
min-height: 100%;
width:10px;
background-color: green;
}
<div>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
<h1>hello</h1>
</div>