I have the following structure in my code and I cannot change the absolute div or panel div - as it's part of existing code and affects multiple pages.
- I need scroll on the relative div and it has to fill the bottom area of the absolute div - So I cannot have height in pixel as it has to match the user screen size.
- I can add more divs inside relative div.
.absolute {
background-color: #F0F0F0;
border: 1px solid #000;
bottom: 0;
left: 0;
overflow: hidden;
position: absolute;
top: 0;
width: 300px;
z-index: 0;
}
.panel {
min-height: 100px;
max-height: 150px;
background: #fff;
display: block;
}
.relative {
overflow: scroll;
}
<div class="absolute">
<div>
<div class="panel">MY PANEL - Variable height</div>
<div class="relative">
Need scroll here
<li>A</li>
<li>A</li>
...
</div>
</div>
</div>