I'm trying to position a div within another div where the height of the parent is defined using vh unit.
Basically, what I need to do is to have the child height = parent height - 50px
.
The parent max-height should be 80% of the height of the screen.
The child height should have a scrollbar to display long content.
I tried a couple of different things but nothing seems to work.
This is what I tried:
.wrapper {
background: yellow;
max-height: 80vh;
width: 300px;
}
.body {
background: pink;
position: absolute;
bottom: 50px;
overflow-y: auto;
top: 0;
}
Do you have any idea? Thanks